コード例 #1
0
        private async void SingerControl_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (e.ClickedItem is SearchSinger item)
            {
                LoadingControl.IsLoading = true;
                var Result = await NetEaseMusic.GetArtistAsync(long.Parse(item.ID));

                LoadingControl.IsLoading = false;
                await Task.Delay(500);

                Image image = ((SingerControl.ContainerFromItem(e.ClickedItem) as ListViewItem).ContentTemplateRoot as FrameworkElement).FindName("SingerImage") as Image;
                ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("ToSingerAnimation", image).Configuration = new BasicConnectedAnimationConfiguration();

                ConnectedAnimationService.GetForCurrentView().DefaultDuration = TimeSpan.FromMilliseconds(400);

                MusicNav.Navigate(typeof(MusicSinger), Result, new SlideNavigationTransitionInfo()
                {
                    Effect = SlideNavigationTransitionEffect.FromRight
                });
            }
        }
コード例 #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            MusicNav = (Frame)e.Parameter;
            switch (PivotControl.SelectedIndex)
            {
            case 1:
            {
                try
                {
                    ConnectedAnimation animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("BackAnimation");
                    if (animation != null)
                    {
                        animation.Configuration = new DirectConnectedAnimationConfiguration();
                        Image image = ((SingerControl.ContainerFromIndex(SingerControl.SelectedIndex) as ListViewItem).ContentTemplateRoot as FrameworkElement).FindName("SingerImage") as Image;
                        animation.TryStart(image);
                    }
                }
                catch (Exception) { }
                break;
            }

            case 2:
            {
                try
                {
                    ConnectedAnimation animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("AlbumBackAnimation");
                    if (animation != null)
                    {
                        animation.Configuration = new DirectConnectedAnimationConfiguration();
                        Image image = ((AlbumControl.ContainerFromIndex(AlbumControl.SelectedIndex) as ListViewItem).ContentTemplateRoot as FrameworkElement).FindName("AlbumImage") as Image;
                        animation.TryStart(image);
                    }
                }
                catch (Exception) { }
                break;
            }
            }
        }