Utility class for WPF MergeMenu support
This file/class is subject to the licensing indicated in the CPOL.htm file
Items in the host menu are expected to have their priorities already set in sorted order, from lowest to highest.
Merged items can be added in any order since they will be added to the host menu one at a time.
Items with the same priority, belong to the same group that will get seperators. Main menu (top level items) don't get seperators
If IsMenuMenu is set to true it will not get seperators. Once added items can not be removed. If you do not want them displayed then
change the Visibility of the menu item. Menu's and Toolbars must be created to be merged. If added to window resources on load window should call
FindResource on the resource to create them. One menu is visible and acts as the host. Other menus that will merge into it appear in
resources and specify a HostId of where it will merge into.
Code is a modified version from
http://www.codeproject.com/Articles/112895/Automatic-Merging-of-Menus-and-Toolbars-in-WPF
Namespace: AppCan.wpf.MenusAssembly: AppCan.wpf (in AppCan.wpf.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C# |
---|
public static class MergeMenus |
Visual Basic |
---|
Public NotInheritable Class MergeMenus |
Visual C++ |
---|
public ref class MergeMenus abstract sealed |
Inheritance Hierarchy
See Also