Skip to content

Commit

Permalink
FInished with initial
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrynixon committed Sep 21, 2016
1 parent 3012bd8 commit 5647cf6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
22 changes: 2 additions & 20 deletions Samples/MultiplePageHeaders/ViewModels/DetailPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ namespace MultiplePageHeaders.ViewModels
{
public class DetailPageViewModel : ViewModelBase
{
public DetailPageViewModel()
{
if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
{
Value = "Designtime value";
}
}

private string _Value = "Default";
public string Value { get { return _Value; } set { Set(ref _Value, value); } }

Expand All @@ -29,19 +21,9 @@ public override async Task OnNavigatedToAsync(object parameter, NavigationMode m
await Task.CompletedTask;
}

public override async Task OnNavigatedFromAsync(IDictionary<string, object> suspensionState, bool suspending)
{
if (suspending)
{
suspensionState[nameof(Value)] = Value;
}
await Task.CompletedTask;
}

public override async Task OnNavigatingFromAsync(NavigatingEventArgs args)
public async void Test()
{
args.Cancel = false;
await Task.CompletedTask;
await NavigationService.NavigateAsync(typeof(Views.DetailPage), Value + " +");
}
}
}
Expand Down
14 changes: 10 additions & 4 deletions Samples/MultiplePageHeaders/Views/ContainerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ public ContainerPage()
this.InitializeComponent();
}

private void Frame1_Loaded(object sender, RoutedEventArgs e)
private async void Frame1_Loaded(object sender, RoutedEventArgs e)
{

var frame = sender as Frame;
var current = Template10.Common.BootStrapper.Current;
var nav = current.NavigationServiceFactory(Template10.Common.BootStrapper.BackButton.Ignore, Template10.Common.BootStrapper.ExistingContent.Exclude, frame);
await nav.NavigateAsync(typeof(DetailPage), "Frame 1");
}

private void Frame2_Loaded(object sender, RoutedEventArgs e)
private async void Frame2_Loaded(object sender, RoutedEventArgs e)
{

var frame = sender as Frame;
var current = Template10.Common.BootStrapper.Current;
var nav = current.NavigationServiceFactory(Template10.Common.BootStrapper.BackButton.Ignore, Template10.Common.BootStrapper.ExistingContent.Exclude, frame);
await nav.NavigateAsync(typeof(DetailPage), "Frame 2");
}
}
}
1 change: 1 addition & 0 deletions Samples/MultiplePageHeaders/Views/DetailPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<StackPanel>
<TextBlock Style="{StaticResource TitleTextBlockStyle}" Text="You passed:" />
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="{x:Bind ViewModel.Value, Mode=OneWay, FallbackValue=DesigntimeValue}" />
<Button Click="{x:Bind ViewModel.Test}">Test</Button>
</StackPanel>
</ScrollViewer>

Expand Down

0 comments on commit 5647cf6

Please sign in to comment.