/// <summary> /// Adds a <see cref="PreferencesMenuItem"/> to the end of the <see cref="MenuItemCollection"/>. /// </summary> /// <param name="click">The action invoked when the child is clicked.</param> public void AddPreferences(Action <IntPtr> click = null) { if (Owner.IsInvalid) { throw new InvalidHandleException(); } PreferencesMenuItem item = new PreferencesMenuItem(new SafeControlHandle(Libui.MenuAppendPreferencesItem(Owner.Handle))); if (click != null) { item.Clicked += (data) => { if (data != null) { click(data); } }; } base.Add(item); }