protected async override void OnNavigatedTo(NavigationEventArgs e) { try { myMusic = await deserialize(); } catch { } if (myMusic.albumList == null || myMusic.songList == null) { await GetMusic(); } ProgressbarMain.ShowPaused = true; MainFrame.Navigate(typeof(AlbumView), myMusic); BackgroundFrame.Navigate(typeof(NowPlaying)); var MediaElementObject = new MediaElement(); Application.Current.Suspending += ForegroundApp_Suspending; Application.Current.Resuming += ForegroundApp_Resuming; ApplicationSettingsHelper.SaveSettingsValue(ApplicationSettingsConstants.AppState, AppState.Active.ToString()); NowPlatingCover.Source = new BitmapImage(new Uri("ms-appx:///Assets/main.png")); NowPlayingTitle.Text = "MusicFlow"; NowPlayingArtist.Text = "For Windows 10"; }
private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e) { Pivot p = sender as Pivot; Debug.Assert(p != null, "p != null"); switch (p.SelectedIndex) { case -1: break; case 0: //Color BackgroundFrame.Navigate(typeof(ColorPage)); Vm.BackgroundVm.BackgroundMode = BackgroundMode.SolidColorBrush; break; case 5: //Gradient Color Brush BackgroundFrame.Navigate(typeof(GradientColorPage)); Vm.BackgroundVm.BackgroundMode = BackgroundMode.GradientColorBrush; break; case 1: //Geometry BackgroundFrame.Navigate(typeof(GeometryPage)); Vm.BackgroundVm.BackgroundMode = BackgroundMode.Geometry; break; } }