private async void Updated(PTTClient sender, LiPttEventArgs e) { switch (e.State) { case PttState.MainPage: await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (pivot_index != pivot.SelectedIndex) { MainFuncFrame.Navigate(typeof(MainFunctionPage)); } }); break; case PttState.Favorite: await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (pivot_index != pivot.SelectedIndex) { FavoriteFrame.Navigate(typeof(FavoritePage)); } }); break; } await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { pivot_index = pivot.SelectedIndex; }); }
protected override void OnNavigatedTo(NavigationEventArgs e) { LiPTT.IsExit = false; MainFuncFrame.Navigate(typeof(MainFunctionPage)); LiPTT.PttEventEchoed += Updated; Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown; }