Esempio n. 1
0
 private void BorderOn_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (!State)
     {
         State = true;
         OnCommand?.Execute(CommandParameter);
     }
 }
Esempio n. 2
0
 private void ExecuteOnOffCommands()
 {
     // Make sure to raise the right command, depending on the IsOn state.
     // Also ensure that each command is executable.
     if (IsOn && OnCommand != null && OnCommand.CanExecute(OnCommandParameter))
     {
         this.TraceVerbose("Executing OnCommand.");
         OnCommand.Execute(OnCommandParameter);
     }
     if (!IsOn && OffCommand != null && OffCommand.CanExecute(OffCommandParameter))
     {
         this.TraceVerbose("Executing OffCommand.");
         OffCommand.Execute(OffCommandParameter);
     }
 }
Esempio n. 3
0
 public void PressOnButton()
 {
     OnCommand.Execute();
 }