public void OnDrop(DragEventArgs e) { //base.OnDrop(e); VideoFolder vf = (VideoFolder)e.Data.GetData(typeof(VideoFolder)); if (vf == null) { vf = (VideoFolder)e.Data.GetData(typeof(VideoFolderChild)); } if (vf == null) { if (MediaControllerVM.CurrentVideoItem != null) { String[] filePathInfo = (String[])e.Data.GetData("FileName", false); for (int i = 0; i < filePathInfo.Length; i++) { FileInfo file = new FileInfo(filePathInfo[i]); if (file.Extension == ".srt") { SubtitleFilesModel.Add(MediaControllerVM.CurrentVideoItem.SubPath, file.FullName); } } ISubtitleMediaController.Subtitle.LoadSub(MediaControllerVM.CurrentVideoItem.SubPath.First()); return; } } if (vf.FileType == FileType.Folder) { VideoFolder vfc = null; foreach (VideoFolder item in vf.OtherFiles) { if (item.FileType == FileType.File) { vfc = item; break; } } if (vfc == null) { return; } MediaControllerVM.GetVideoItem(vfc as VideoFolderChild); return; } MediaControllerVM.GetVideoItem(vf as VideoFolderChild); CommandManager.InvalidateRequerySuggested(); }
private void Previous_enabled(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = MediaControllerVM.CanPrev(); }
private static void InitInstance() { currentInstance = new MediaControllerVM(); }
private void Next_enabled(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = MediaControllerVM.CanNext(); }