示例#1
0
 void _icon_MouseClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (e.ChangedButton == MouseButton.Left && LeftClickCommand != null && LeftClickCommand.CanExecute(sender))
     {
         LeftClickCommand.Execute(sender);
     }
     else if (e.ChangedButton == MouseButton.Right && RightClickCommand != null && RightClickCommand.CanExecute(sender))
     {
         RightClickCommand.Execute(sender);
     }
 }
示例#2
0
 private void UIElement_OnMouseRightButtonUp(object sender, MouseButtonEventArgs e)
 {
     RightClickCommand?.Execute(null);
 }
 async private void _control_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
 {
     await RightClickCommand.Execute();
 }