public ConvertCommand(MappingsSourceViewModel receiver) : base("Convert Files", "Convert Files", typeof(ConvertCommand), new InputGestureCollection { new KeyGesture(Key.C, ModifierKeys.Control | ModifierKeys.Alt) }) { _mappingsSource = receiver; }
public AddVideoFilesCommand(MappingsSourceViewModel receiver) : base("Add Files", "Add Files", typeof(AddVideoFilesCommand), new InputGestureCollection { new KeyGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift) }) { _mappingsSource = receiver; }
public SaveFileCommand(MappingsSourceViewModel receiver) : base("Save File", "Save File", typeof(AddVideoFilesCommand), new InputGestureCollection { new KeyGesture(Key.S, ModifierKeys.Control) }) { _mappingsSource = receiver; }
public void Execute(object parameter) { var openFileDialog = new OpenFileDialog { Filter = Constants.FileFilter, Multiselect = false }; if (openFileDialog.ShowDialog() == true) { var reader = new MappingsSourceReader(); var source = reader.Read(openFileDialog.FileName); MappingsSource = new MappingsSourceViewModel { FileName = openFileDialog.FileName, Mappings = new MappingsCollection(source.Mappings) }; } }
private void LoadSource(MappingsSourceViewModel source) { MediaContainer.Visibility = Visibility.Hidden; if (source == null) { return; } _current = source; DataContext = _current; if (source == null) { return; } SaveFilesMenuItem.IsEnabled = true; AddFilesMenuItem.IsEnabled = true; if (source.Mappings.Any()) { ConvertFilesMenuItem.IsEnabled = true; } }