private void New_Executed(object sender, ExecutedRoutedEventArgs e) { if (NewClicked != null) { NewClicked.Invoke(); } }
public AddRemovePropertyGrid() { _btnNew = new("New subscription") { Image = global::DarcUI.Properties.Resources.add, Visible = false }; _btnDelete = new("Delete subscription") { Image = global::DarcUI.Properties.Resources.delete, Visible = false }; _btnNew.Click += (s, e) => NewClicked?.Invoke(this, e); _btnDelete.Click += (s, e) => DeleteClicked?.Invoke(this, e); ToolStrip toolbar = GetToolbar(); toolbar.Items.Add(_separator = new ToolStripSeparator { Visible = false }); toolbar.Items.Add(_btnNew); toolbar.Items.Add(_btnDelete); }