private void Open_Click(object sender, RoutedEventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "Mediendateien(*.avi, *.mpg)|*.avi;*.mpg;*.wmv|Alle Dateien|*.*"; dlg.Multiselect = true; if (dlg.ShowDialog().Value == true) { if (dlg.FileNames.Count() == 0) { return; } foreach (string filename in dlg.FileNames) { _FileInfo NewFile = new _FileInfo { FullName = filename }; _fileList.Items.Add(NewFile); b = false; _SelectedFilePath = NewFile.FullName; this.Title = NewFile.ToString(); } Func(); b = true; } }
private void _fileList_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (b) { _FileInfo NewFile = _fileList.SelectedValue as _FileInfo; _SelectedFilePath = NewFile.FullName; Func(); this.Title = NewFile.ToString(); } }
private void Window_Drop(object sender, DragEventArgs e) { string[] files = e.Data.GetData(DataFormats.FileDrop) as string[]; if (files == null) { return; } foreach (string filename in files) { _FileInfo NewFile = new _FileInfo { FullName = filename }; _fileList.Items.Add(NewFile); b = false; _SelectedFilePath = NewFile.FullName; this.Title = NewFile.ToString(); } Func(); b = true; }