private void DownedVideo_SelectionChanged(object sender, SelectionChangedEventArgs e) { //选择模式不跳转 if (DownVideoList.SelectedIndex == -1) { if (IsEditMode) { deleteSelectBtn.IsEnabled = false; } return; } if (IsEditMode) { if (DownVideoList.SelectedItems.Count == 0) { deleteSelectBtn.IsEnabled = false; } else if (DownVideoList.SelectedItems.Count > 0) { deleteSelectBtn.IsEnabled = true; } return; } DownVideoInfoViewMoel DownVideo = DownVideoList.SelectedItem as DownVideoInfoViewMoel; if (DownVideo == null) { return; } App.PlayerModel.VideoId = DownVideo.VideoId; App.PlayerModel.currentType = ViewModels.PlayerViewModel.PlayType.LoaclType; this.NavigationService.Navigate(new Uri(CommonData.PlayerPageName, UriKind.Relative)); }
private void LoadLocalVideoList() { fullScreen_Click(null, null); Binding videos = new Binding(); videos.Path = new PropertyPath("DownedVideo"); AllDramas.SetBinding(ListBox.ItemsSourceProperty, videos); App.PlayerModel.VideoStyleType = "2"; App.PlayerModel.CurrentDefinitionName = "本地"; int index = -1; for (int i = 0; i < AllDramas.Items.Count; i++) { DownVideoInfoViewMoel info = AllDramas.Items[i] as DownVideoInfoViewMoel; if (info != null && info.VideoId == App.PlayerModel.VideoId) { index = i; break; } } if (AllDramas.Items.Count > 0) { AllDramas.SelectedIndex = index; } }
private void VideoRemember_Changed(object sender, SelectionChangedEventArgs e) { DownVideoInfoViewMoel DownVideo = VideoRemember.SelectedItem as DownVideoInfoViewMoel; if (DownVideo == null) { return; } App.PlayerModel.VideoId = DownVideo.VideoId; App.PlayerModel.currentType = ViewModels.PlayerViewModel.PlayType.VideoType; this.NavigationService.Navigate(new Uri(CommonData.PlayerPageName, UriKind.Relative)); }
private void AllDramas_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (AllDramas.SelectedIndex == -1) { if (IsDownMode) { startDownBtn.IsEnabled = false; } return; } if (App.PlayerModel.currentType == PlayerViewModel.PlayType.LoaclType) { DownVideoInfoViewMoel info = AllDramas.SelectedItem as DownVideoInfoViewMoel; if (info == null) { return; } App.PlayerModel.VideoId = info.VideoId; App.PlayerModel.VideoName = info.Name; SetLocalMedia(info.LocalDownloadUrl); currentDramaIndex = AllDramas.SelectedIndex; App.PlayerModel.NextVisibility = (AllDramas.Items.Count > currentDramaIndex + 1) ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed; App.PlayerModel.PreviousVisibility = (currentDramaIndex - 1 >= 0) ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed; AllVideos.ScrollIntoView(AllVideos.SelectedItem); } else { if (IsDownMode) { if (AllDramas.SelectedItems.Count == 0) { startDownBtn.IsEnabled = false; } else if (AllDramas.SelectedItems.Count > 0) { startDownBtn.IsEnabled = true; } } else { if (currentDramaIndex != AllDramas.SelectedIndex) { VideoInfo info = AllDramas.SelectedItem as VideoInfo; if (info == null) { return; } App.PlayerModel.VideoId = info.videoId; App.PlayerModel.ReloadNewVideo(); App.PlayerModel.PlayerVideo(info); App.PlayerModel.VideoDownloadUrl = info.downloadUrl; CreateDefinitonList(info.downloadUrl); RelatedVideos.SelectedIndex = -1; currentDramaIndex = AllDramas.SelectedIndex; App.PlayerModel.currentType = MangGuoTv.ViewModels.PlayerViewModel.PlayType.VideoType; App.PlayerModel.NextVisibility = (AllDramas.Items.Count > currentDramaIndex + 1) ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed; App.PlayerModel.PreviousVisibility = (currentDramaIndex - 1 >= 0) ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed; App.PlayerModel.MoreCommentVisibility = Visibility.Collapsed; App.PlayerModel.MoreVideoVisibility = Visibility.Collapsed; } AllDramas.ScrollIntoView(AllDramas.SelectedItem); } } }