Ejemplo n.º 1
0
        ////protected override AnimatorHelperBase GetAnimation(AnimationType animationType, Uri toOrFrom)
        ////{
        ////    return null;
        ////}


        ////private void MainPage_Unloaded(object sender, RoutedEventArgs e)
        ////{
        ////    this.Unloaded -= this.MainPage_Unloaded;
        ////}


        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            this.historyItemLaunch = false;
            this.playMixId         = null;
            try
            {
                if (e.NavigationMode == NavigationMode.New && NavigationContext.QueryString.ContainsKey(PlayMixKey))
                {
                    // We were launched from a history item.
                    // Change _playingSong even if something was already playing
                    // because the user directly chose a song history item.

                    // Use the navigation context to find the song by name.
                    this.playMixId = NavigationContext.QueryString[PlayMixKey];

                    // Set a flag to indicate that we were started from a
                    // history item and that we should immediately start
                    // playing the song once the UI has finished loading.
                    this.historyItemLaunch = true;

                    if (this.historyItemLaunch)
                    {
                        this.NavigationService.Navigate(PageUrl.Play(this.playMixId, true));
                    }

                    return;
                }

                base.OnNavigatedTo(e);
            }
            catch (InvalidOperationException)
            {
                // Couldn't navigate we're probably being closed
            }
        }