Example #1
0
        private async void MV_PointerPressed(object sender, PointerRoutedEventArgs e)
        {
            LoadingControl.IsLoading        = true;
            SingleMusicControl.SelectedItem = ((TextBlock)sender).DataContext;
            var Result = await NetEaseMusic.GetMVAsync((int)SingleMusicList[SingleMusicControl.SelectedIndex].MVid);

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

            MusicPage.ThisPage.MusicNav.Navigate(typeof(MusicMV), Result.Data, new SlideNavigationTransitionInfo()
            {
                Effect = SlideNavigationTransitionEffect.FromRight
            });
        }
Example #2
0
        public MusicMV()
        {
            InitializeComponent();
            ThisPage = this;
            MVSuggestControl.ItemsSource = MVSuggestionCollection;

            Loaded += async(s, e) =>
            {
                if (IsSame)
                {
                    IsSame = false;
                    return;
                }

                MVControl.MediaPlayer.PlaybackSession.PlaybackStateChanged += PlaybackSession_PlaybackStateChanged;
                MVControl.MediaPlayer.MediaFailed += MediaPlayer_MediaFailed;

                MVControl.Source = MediaSource.CreateFromUri(MovieUri);
                var Result = await NetEase.GetArtistAsync(ArtistID);

                foreach (var Song in Result.HotSongs.Where(Song => Song.Mv != 0).Select(Song => Song))
                {
                    var MVResult = await NetEase.GetMVAsync((int)Song.Mv);

                    if (MVResult.Data.BriefDesc == "")
                    {
                        MVSuggestionCollection.Add(new MVSuggestion(MVResult.Data.Name, "无简介", (int)Song.Mv, new Uri(MVResult.Data.Cover)));
                    }
                    else
                    {
                        MVSuggestionCollection.Add(new MVSuggestion(MVResult.Data.Name, MVResult.Data.BriefDesc, (int)Song.Mv, new Uri(MVResult.Data.Cover)));
                    }

                    if (MVName.Text == MVResult.Data.Name)
                    {
                        MVSuggestControl.SelectedItem = MVSuggestionCollection[MVSuggestionCollection.Count - 1];
                    }
                }

                if (MVSuggestControl.SelectedItem != null)
                {
                    MVSuggestControl.ScrollIntoViewSmoothly(MVSuggestControl.SelectedItem, ScrollIntoViewAlignment.Leading);
                }

                MVSuggestControl.SelectionChanged += MVSuggestControl_SelectionChanged;
            };
        }