/// <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 SaveToDBCommandBinding(ShellViewModel viewModel, Window owner) { this.Command = ShellCommands.SaveToDB; this.CanExecute += delegate(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = SaveToDBCommand.CanExecute(viewModel); }; this.Executed += delegate(object sender, ExecutedRoutedEventArgs e) { SaveToDBCommand.Execute(viewModel, owner); }; }
internal static void Execute(ShellViewModel viewModel, Window owner) { SaveToDBCommand.Save(viewModel, owner); }
internal static bool CanExecute(ShellViewModel viewModel) { return(SaveToDBCommand.CanSave(viewModel)); }