private async void Commands_LoadMedia(object sender, ExecutedRoutedEventArgs e) { Command_UnloadMedia(null, null); CommonOpenFileDialog fileDialog = new CommonOpenFileDialog { Title = "打开媒体文件", DefaultDirectory = Environment.CurrentDirectory, IsFolderPicker = false, AllowNonFileSystemItems = true, EnsurePathExists = true, Multiselect = false, //Filters = { new CommonFileDialogFilter("波形音频", ".wav") }, EnsureFileExists = true }; if (fileDialog.ShowDialog() != CommonFileDialogResult.Ok) { return; } if (!DockControl?.IsVisible ?? true) { DockControl?.Show(); } MediaLoaded = true; Playing = true; //MediaPlayer.Play(new Media(_libVLC, fileDialog.FileName)); await VideoElement.Open(new Uri(fileDialog.FileName)); await VideoElement.Play(); }