/// <summary> /// Adds a new <see cref="PreferencesMenuItem"/> to the list. /// </summary> /// <param name="click">The action invoked when the item is clicked.</param> public void AddPreferencesItem(Action <IntPtr> click = null) { PreferencesMenuItem item = new PreferencesMenuItem(LibuiLibrary.uiMenuAppendPreferencesItem(Handle.DangerousGetHandle())); if (click != null) { item.Clicked += (sender, args) => { if (args != null) { click(args.Data); } }; } Items.Add(item); }
/// <summary> /// Adds a new <see cref="PreferencesMenuItem"/> to the list. /// </summary> /// <param name="click">The action invoked when the item is clicked.</param> public void AddPreferencesItem(Action <IntPtr> click = null) { PreferencesMenuItem item = new PreferencesMenuItem(Libui.uiMenuAppendPreferencesItem(this)); if (click != null) { item.Clicked += (sender, args) => { if (args != null) { click(args.Data); } }; } Items.Add(item); }