// Navigator changed event
        private void DashboardPageChanged(object sender, DashboardPageEventArgs e)
        {
            selectedDashboardPage = e.SelectedPage;

            // Change background color
            if (selectedDashboardPage.ShouldUseLightBackground)
                LayoutRoot.Background = new SolidColorBrush(Colors.White);
            else
                LayoutRoot.Background = new SolidColorBrush(Colors.Black);

            // Fade out the old image
            Storyboard animation = new Storyboard();
            animation.Duration = new Duration(TimeSpan.FromSeconds(0.3));

            DoubleAnimation fadeOutAnimation = new DoubleAnimation();
            animation.Children.Add(fadeOutAnimation);
            fadeOutAnimation.Duration = animation.Duration;
            fadeOutAnimation.To = 0;
            Storyboard.SetTarget(fadeOutAnimation, BackgroundImage);
            Storyboard.SetTargetProperty(fadeOutAnimation, new PropertyPath("Opacity"));

            animation.Completed += FadeOutAnimationCompleted;
            animation.Begin();
        }
        private void OnDashboardPageChanged(object sender, DashboardPageEventArgs e)
        {
            selectedDashboardPage = e.SelectedPage;

            if (selectedDashboardPage.ShouldUseLightBackground && BackgroundImage.Source == lightBackgroundImage)
                return;

            if (!selectedDashboardPage.ShouldUseLightBackground && BackgroundImage.Source == darkBackgroundImage)
                return;

            // Fade out the old image
            Storyboard animation = new Storyboard();
            animation.Duration = new Duration(TimeSpan.FromSeconds(0.3));

            DoubleAnimation fadeOutAnimation = new DoubleAnimation();
            animation.Children.Add(fadeOutAnimation);
            fadeOutAnimation.Duration = animation.Duration;
            fadeOutAnimation.To = 0;
            Storyboard.SetTarget(fadeOutAnimation, BackgroundImage);
            Storyboard.SetTargetProperty(fadeOutAnimation, new PropertyPath("Opacity"));

            animation.Completed += FadeOutAnimationCompleted;
            animation.Begin();
        }
        private void OnDashboardPageChanged(object sender, DashboardPageEventArgs e)
        {
            if (executedOnce || e.SelectedPage != this)
                return;

            executedOnce = true;

            // Prepare data source
            dataSource = new ObservableCollection<ModelBase>();
            dataSource.Insert(0, Cinderella.CinderellaCore.CurrentUser);
            SummersaltListView.ItemsSource = dataSource;

            // Get user info
            Anaconda.AnacondaCore.GetUserInfoAsync(Cinderella.CinderellaCore.CurrentUser.ResourceId);

            // Load contact photos
            Anaconda.AnacondaCore.GetContactPhotosAsync();
        }
 // Navigator changed event
 private void DashboardPageChanged(object sender, DashboardPageEventArgs e)
 {
     if (e.SelectedPage.PageName == "PreludePage")
     {
         ApplicationBar = GetPreludeAppBar();
     }
     else if (e.SelectedPage.PageName == "VioletPage")
     {
         ApplicationBar = GetVioletAppBar();
     }
     else if (e.SelectedPage.PageName == "SummersaltPage")
         ApplicationBar = GetSummersaltAppBar();
 }
 private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     var evt = new DashboardPageEventArgs();
     PivotItem selectedItem = MainPivot.SelectedItem as PivotItem;
     evt.SelectedPage = (IDashboardPage)selectedItem.Content;
     DashboardPageChanged.DispatchEvent(this, evt);
 }