private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            if (!(e.Source is Button button))
            {
                return;
            }
            switch (button.Name)
            {
            case "LeftButton":
                LeftButtonClick?.Invoke(this, EventArgs.Empty);
                break;

            case "RightButton":
                RightButtonClick?.Invoke(this, EventArgs.Empty);
                break;
            }
        }
 private void LeftButton_Click(object sender, EventArgs e)
 {
     LeftButtonClick?.Invoke(sender, e);
 }
Exemple #3
0
 private void btnLeft_Click(object sender, RoutedEventArgs e)
 {
     LeftButtonClick?.Invoke(this, EventArgs.Empty);
 }
 protected virtual void OnLeftButtonClicked(MouseEventArgs e)
 {
     LeftButtonClick?.Invoke(this, e);
 }
 protected virtual void OnLeftButtonClick(EventArgs e) => LeftButtonClick?.Invoke(this, e);