void ExecuteCommand()
 {
     if (CompletedCommand?.CanExecute(CommandParameter ?? this) ?? false)
     {
         CompletedCommand?.Execute(CommandParameter ?? this);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Sends the completed.
 /// </summary>
 public void SendCompleted()
 {
     Completed?.Invoke(this, EventArgs.Empty);
     if (CompletedCommand != null)
     {
         if (CompletedCommand.CanExecute(null))
         {
             CompletedCommand.Execute(null);
         }
     }
 }
Beispiel #3
0
        /// <summary>
        /// Handles firing off events and commands if necessary.
        /// </summary>
        /// <param name="pin">The current pin.</param>
        protected virtual void OnPinChanged(string pin)
        {
            if (string.IsNullOrEmpty(pin))
            {
                return;
            }

            if (pin.Length == Length)
            {
                var handler = PinCompleted;

                if (CompletedCommand != default(Command))
                {
                    if (CompletedCommand.CanExecute(pin))
                    {
                        CompletedCommand.Execute(pin);
                    }
                }

                handler?.Invoke(this, new PinCompletedEventArgs(pin));
            }
        }