diff --git a/YJMPD-UWP/App.xaml.cs b/YJMPD-UWP/App.xaml.cs index 2ed0978..b33321c 100644 --- a/YJMPD-UWP/App.xaml.cs +++ b/YJMPD-UWP/App.xaml.cs @@ -9,6 +9,7 @@ using Windows.UI.ViewManagement; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; +using Windows.ApplicationModel.Core; namespace YJMPD_UWP { @@ -134,13 +135,44 @@ namespace YJMPD_UWP public static bool Navigate(Type type) { App.Geo.TryConnectIfNull(); - return ContentFrame.Navigate(type); + + if(Window.Current == null) + { + CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync( + CoreDispatcherPriority.High, + new DispatchedHandler(() => + { + ContentFrame.Navigate(type); + })); + + return true; + } + else + { + return ContentFrame.Navigate(type); + } + } public static bool Navigate(Type type, object param) { App.Geo.TryConnectIfNull(); - return ContentFrame.Navigate(type, param); + + if (Window.Current == null) + { + CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync( + CoreDispatcherPriority.High, + new DispatchedHandler(() => + { + ContentFrame.Navigate(type, param); + })); + + return true; + } + else + { + return ContentFrame.Navigate(type, param); + } } diff --git a/YJMPD-UWP/MainPage.xaml.cs b/YJMPD-UWP/MainPage.xaml.cs index 27c9071..8d6c535 100644 --- a/YJMPD-UWP/MainPage.xaml.cs +++ b/YJMPD-UWP/MainPage.xaml.cs @@ -105,7 +105,6 @@ namespace YJMPD_UWP NavList.SelectedIndex = 3; break; default: - PageTitle.Text = "YJMPD-UWP"; break; }