示例#1
0
 private void command_CanExecuteChanged(object sender, EventArgs e)
 {
     if (command != null)
     {
         IsEnabled = command.CanExecute(null);
     }
 }
示例#2
0
        private void ExecuteButtonCommand(object sender, EventArgs e, DialogButton button)
        {
            if (button != null)
            {
                if (!string.IsNullOrEmpty(button.Command))
                {
                    ICommandCore command = ApplicationManager.Current.CommandStore[button.Command];

                    if (command != null)
                    {
                        if (command.CanExecute(null))
                        {
                            command.Execute(null);
                        }
                    }
                }
            }

            DialogClosing(sender, e);
        }