private void StopButton_Click(object sender, RoutedEventArgs e)
 {
     Stop();
     if (StopCommand != null && StopCommand.CanExecute(EMPTY_PARAMETER))
     {
         StopCommand.Execute(EMPTY_PARAMETER);
     }
 }
Beispiel #2
0
 private void StopTimer()
 {
     Timer.Stop();
     Stopped?.Invoke(this, EventArgs.Empty);
     if (StopCommand?.CanExecute(StopCommandParameter) == true)
     {
         StopCommand?.Execute(StopCommandParameter);
     }
 }
Beispiel #3
0
        /// <summary>
        /// Stops this instance.
        /// </summary>
        public void Stop()
        {
            if (StopCommand?.CanExecute(null) == true)
            {
                StopCommand?.Execute(null);

                MediaState = MediaState.Stopped;
                OnMediaStateChanged();
            }
        }
 private void OnReleased(object sender, EventArgs e)
 {
     if (StopCommand == null)
     {
         return;
     }
     if (StopCommand.CanExecute(BindingContext))
     {
         StopCommand.Execute(BindingContext);
     }
 }
        public IVirtualMachineCommand GetCommand(VirtualMachineCommand command)
        {
            if (RestartCommand.CanExecute(command.Action))
            {
                return(new RestartCommand(VirtualMachineService, command));
            }
            else if (StartCommand.CanExecute(command.Action))
            {
                return(new StartCommand(VirtualMachineService, command));
            }
            else if (StopCommand.CanExecute(command.Action))
            {
                return(new StopCommand(VirtualMachineService, command));
            }

            return(null);
        }