public void SetNoContextTarget() { List <MenuListItem> items = new List <MenuListItem>(); items.AddRange(defaultItems); items.AddRange(noContextItems); MenuChanged?.Invoke(items); }
public void SetContextMouseTarget(EntityViewModel target) { List <MenuListItem> items = new List <MenuListItem>(); items.AddRange(defaultItems); items.AddRange(contextItems); items.Add(new SeperatorMenuItem(target.Name)); MenuChanged?.Invoke(items); }
public void TriggerMenuChanged() { MenuChanged?.Invoke(this, null); foreach (var menuCommand in GetMenuCommandsWithoutSeparators()) { menuCommand.SetCheckForRegisteredMenuItems(); menuCommand.UpdateMenuItemsShortcutKeyDisplayString(); } }
//called when a menu change is requested protected virtual void OnMenu(EventData eventData) { //non-null if an object has subscribed to this event MenuChanged?.Invoke(eventData); /* * //Old form: * if (MenuChanged != null) * MenuChanged(eventData); */ }
// taken from http://stackoverflow.com/questions/5058254/inotifypropertychanged-propertychangedeventhandler-event-is-always-null // paramenter name not used protected void OnMenuChanged() { Debug.WriteLine("RevisionGridMenuCommands.OnPropertyChanged()"); MenuChanged?.Invoke(this, null); foreach (var menuCommand in GetMenuCommandsWithoutSeparators()) { menuCommand.SetCheckForRegisteredMenuItems(); menuCommand.UpdateMenuItemsShortcutKeyDisplayString(); } }
internal static void InvokeMenuChanged(IClickableMenu priorMenu, IClickableMenu newMenu) { MenuChanged.Invoke(null, new EventArgsClickableMenuChanged(priorMenu, newMenu)); }
//called when a menu is shown, hidden or modified protected virtual void OnMenuChanged(EventData eventData) { MenuChanged?.Invoke(eventData); }
internal static void CallMenuChanged(string newName) { MenuChanged?.Invoke(null, new StringDataEventArgs(newName)); }
public static void InvokeMenuChanged(IClickableMenu newMenu) { MenuChanged.Invoke(newMenu); }
private void Button1_OnClicked(object sender, EventArgs e) { MenuChanged?.Invoke(this, 1); MarkerBoxView.LayoutTo((sender as VisualElement).Bounds, 150, Easing.CubicInOut); }
private void OnMenuChanged(MenuItemName menuName) { MenuChanged?.Invoke(this, new MenuChangedEventArgs(menuName)); }