Esempio n. 1
0
 private void UpdateEnabledState()
 {
     this.Enabled =
         (!DisableWhenNoCommand && ClickCommand == null)
         ||
         (ClickCommand != null && ClickCommand.CanExecute(ClickCommandParameter));
 }
Esempio n. 2
0
        private async Task ButtonPressed()
        {
            await Animate();

            if (ClickCommand != null && ClickCommand.CanExecute(ClickCommandParameter))
            {
                ClickCommand.Execute(ClickCommandParameter);
            }
        }
        private void AssociatedObject_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            if (ClickCommand == null || !ClickCommand.CanExecute(ClickCommandParameter))
            {
                return;
            }

            ClickCommand.Execute(ClickCommandParameter);
        }
Esempio n. 4
0
 protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
 {
     base.OnMouseLeftButtonDown(e);
     if (e.ClickCount == 1 && ((DragCommand != null && DragCommand.CanExecute(CommandParameter)) || (ClickCommand != null && ClickCommand.CanExecute(CommandParameter))))
     {
         _mouseDownPoint = e.GetPosition(this);
         _isMouseDown    = true;
         CaptureMouse();
     }
 }
Esempio n. 5
0
 private void UpdateCursor()
 {
     Cursor = (DragCommand != null && DragCommand.CanExecute(CommandParameter)) || (ClickCommand != null && ClickCommand.CanExecute(CommandParameter)) ? Cursors.Hand : Cursors.Arrow;
 }