Exemplo n.º 1
0
 /// <param name="action">The wrapped action command</param>
 /// <param name="dialog">The dialog containing the action</param>
 public ActionCommandWrapper(ActionCommandBase action, IDialog dialog)
 {
     if (action is ActionCommand ac)
     {
         if (ac.Action != null)
         {
             Command = new RelayCommand(ac.Action);
         }
     }
     else if (action is AsyncActionCommand asc)
     {
         if (asc.Action != null)
         {
             Command = new RelayCommand(async() =>
             {
                 try
                 {
                     var res = await asc.Action();
                     if (res)
                     {
                         dialog.Close();
                     }
                 }
                 catch (ValidationException)
                 {
                 }
             });
         }
     }
     Tag   = action.Tag;
     Title = action.Title;
     HorizontalPosition        = action.HorizontalPosition == Coddee.HorizontalPosition.Left ? Dock.Left : Dock.Right;
     action.CanExecuteChanged += ActionCanExecuteChanged;
     CanExecute = action.CanExecute;
 }
Exemplo n.º 2
0
 public TestCaseCommand(ActionCommandBase razorcommand) : base("Test", "Test case command")
 {
     _razorcommand = razorcommand;
     //RegisterCommand(new )
 }