Skip to content

DevExpress-Examples/how-to-merge-bars-when-they-are-used-in-standard-controls-t239281

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files to look at:

How to: Merge Bars When They are Used in Standard Controls

This example demonstrates the merging behavior of bars when they are used in controls that don't support automatic merging.

The example creates a TabControl in which a Tab contains three MainMenuControls:
1) an empty menu called 'elementHost',
2) a menu with 'Cut', 'Copy' and 'Paste' commands,
3) a menu with 'Left', 'Center' and 'Right' commands.
The second and third MainMenuControls will be merged to the first MainMenuControl.

The merging feature is enabled with the ElementMergingBehavior property attached to the Tab. This property is set to 'InternalWithInternal', which means that the Tab's internal elements are merged with other internal elements that are defined in parent name scopes. 
The 'elementHost' MainMenuControl belongs to the name scope inherited from the Window object (a name scope is implicitly created for each Window object). The IsScopeOwner properties set for the second and third MainMenuControls define child name scopes. Thus, these MainMenuControls will be merged to the 'elementHost' MainMenuControl (defined in the parent name scope).

Note:
If you want to merge the Tab's second and third MainMenuControls to the Window's topmost MainMenuControl (the one that contains 'File', 'Settings' and 'Exit' commands), replace the Tab's property setting:
dxb:MergingProperties.ElementMergingBehavior="InternalWithInternal"
with:
dxb:MergingProperties.ElementMergingBehavior="InternalWithExternal"


Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

Releases

No releases published

Packages

No packages published