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 btnRight_Click(object sender, RoutedEventArgs e) { RightButtonClick?.Invoke(this, EventArgs.Empty); }
private void RightButton_Click(object sender, EventArgs e) { RightButtonClick?.Invoke(sender, e); }
protected virtual void OnRightButtonClick(EventArgs e) => RightButtonClick?.Invoke(this, e);