/// <summary> /// Initializes a new instance of the <see cref="SaveToDBCommandBinding<TController, TModel>"/> class. /// </summary> /// <param name="viewModel">The view model.</param> /// <param name="owner">The owner window.</param> public SaveAsToDBCommandBinding(ShellViewModel viewModel, Window owner) { this.Command = ShellCommands.SaveAsToDB; this.CanExecute += delegate(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = SaveAsToDBCommand.CanExecute(viewModel); }; this.Executed += delegate(object sender, ExecutedRoutedEventArgs e) { SaveAsToDBCommand.Execute(viewModel, owner); }; }
internal static void Execute(ShellViewModel viewModel, Window owner) { SaveAsToDBCommand.Save(viewModel, owner); }
internal static bool CanExecute(ShellViewModel viewModel) { return(SaveAsToDBCommand.CanSave(viewModel)); }