Small refactor in MainPage

This commit is contained in:
bg45
2017-10-26 15:45:37 -04:00
committed by BONNEVILLE Geoffroy
parent d10f617910
commit b89998c053
2 changed files with 26 additions and 19 deletions

View File

@@ -28,29 +28,11 @@ namespace ModernKeePass.Pages
selectedItem?.Destination.Navigate(selectedItem.PageType, selectedItem.Parameter);
}
#region NavigationHelper registration
/// The methods provided in this section are simply used to allow
/// NavigationHelper to respond to the page's navigation methods.
///
/// Page specific logic should be placed in event handlers for the
/// <see cref="Common.NavigationHelper.LoadState"/>
/// and <see cref="Common.NavigationHelper.SaveState"/>.
/// The navigation parameter is available in the LoadState method
/// in addition to page state preserved during an earlier session.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
NavigationHelper.OnNavigatedTo(e);
base.OnNavigatedTo(e);
DataContext = new MainVm(Frame, MenuFrame);
if (Model.SelectedItem == null) MenuFrame.Navigate(typeof(WelcomePage));
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
NavigationHelper.OnNavigatedFrom(e);
}
#endregion
}
}