Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]Controls and Libraries
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Collapse]API Reference
  [Expand]DevExpress.Charts.Designer
  [Expand]DevExpress.Mvvm.UI
  [Expand]DevExpress.Mvvm.UI.Interactivity
  [Expand]DevExpress.Mvvm.UI.ModuleInjection
  [Expand]DevExpress.Xpf.Accordion
  [Collapse]DevExpress.Xpf.Bars
   [Expand]AddBarAction Class
   [Expand]AddBarItemAction Class
   [Expand]AddBarItemLinkAction Class
   [Expand]Bar Class
   [Expand]BarActionBase Class
   [Expand]BarButtonItem Class
   [Expand]BarButtonItemLink Class
   [Expand]BarCheckItem Class
   [Expand]BarCheckItemLink Class
   [Expand]BarCollection Class
   [Expand]BarContainerControl Class
    BarContainerType Enumeration
   [Expand]BarDockInfo Class
   [Expand]BarEditItem Class
   [Expand]BarEditItemLink Class
   [Expand]BarItem Class
   [Expand]BarItemActionBase Class
    BarItemAlignment Enumeration
    BarItemAutoSizeMode Enumeration
   [Expand]BarItemCollection Class
    BarItemDisplayMode Enumeration
   [Expand]BarItemLink Class
   [Expand]BarItemLinkActionBase Class
   [Expand]BarItemLinkBase Class
   [Expand]BarItemLinkCollection Class
   [Expand]BarItemLinkHolderBase Class
   [Expand]BarItemLinkMenuHeader Class
   [Expand]BarItemLinkSeparator Class
   [Expand]BarItemMenuHeader Class
    BarItemMergeType Enumeration
   [Expand]BarItemSeparator Class
   [Expand]BarLinkContainerItem Class
   [Expand]BarLinkContainerItemLink Class
   [Expand]BarListItem Class
   [Expand]BarListItemLink Class
   [Collapse]BarManager Class
     BarManager Members
     BarManager Constructor
    [Expand]BarManager Properties
    [Expand]BarManager Events
    [Expand]BarManager Methods
   [Expand]BarManagerActionCollection Class
   [Expand]BarManagerActionContainer Class
   [Expand]BarManagerCategory Class
   [Expand]BarManagerCategoryCollection Class
   [Expand]BarManagerController Class
   [Expand]BarManagerControllerActionBase Class
   [Expand]BarManagerControllerBase Class
   [Expand]BarNameScope Class
   [Expand]BarPopupBase Class
   [Expand]BarsLocalizer Class
   [Expand]BarSplitButtonItem Class
   [Expand]BarSplitButtonItemLink Class
   [Expand]BarSplitCheckItem Class
   [Expand]BarSplitCheckItemLink Class
   [Expand]BarStaticItem Class
   [Expand]BarStaticItemLink Class
   [Expand]BarSubItem Class
   [Expand]BarSubItemLink Class
    ButtonSwitcher Enumeration
   [Expand]CreateStandardLayoutAction Class
    ElementMergingBehavior Enumeration
   [Expand]Gallery Class
    GalleryCheckDrawMode Enumeration
   [Expand]GalleryControl Class
   [Expand]GalleryItem Class
    GalleryItemCheckMode Enumeration
   [Expand]GalleryItemCollection Class
   [Expand]GalleryItemGroup Class
   [Expand]GalleryItemGroupCollection Class
    GallerySizeMode Enumeration
    GlyphSize Enumeration
   [Expand]IControllerAction Interface
   [Expand]ILinksHolder Interface
   [Expand]InsertAction Class
   [Expand]InsertBarAction Class
   [Expand]InsertBarItemAction Class
   [Expand]InsertBarItemLinkAction Class
   [Expand]InsertMainMenuIfNotExistAction Class
   [Expand]InsertStatusBarIfNotExistAction Class
   [Expand]ItemClickEventArgs Class
    ItemClickEventHandler Delegate
    ItemLinksHolderType Enumeration
   [Expand]LayoutUpgradingEventArgs Class
    LayoutUpgradingEventHandler Delegate
   [Expand]LinkListItem Class
   [Expand]LinkListItemLink Class
   [Expand]MainMenuControl Class
    MDIMergeStyle Enumeration
   [Expand]MergingProperties Class
   [Expand]PopupControlContainer Class
   [Expand]PopupControlContainerInfo Class
   [Expand]PopupInfo<PopupType> Class
   [Expand]PopupMenu Class
   [Expand]PopupMenuBase Class
   [Expand]PopupMenuInfo Class
    PopupMenuItemsDisplayMode Enumeration
   [Expand]RadialContextMenu Class
   [Expand]RemoveAction Class
   [Expand]RemoveBarAction Class
   [Expand]RemoveBarItemAction Class
   [Expand]RemoveBarItemAndLinkAction Class
   [Expand]RemoveBarItemLinkAction Class
   [Expand]ReplaceAction Class
    RibbonItemStyles Enumeration
   [Expand]SetBarAction Class
   [Expand]SetBarItemAction Class
   [Expand]SetBarItemLinkAction Class
   [Expand]StatusBarControl Class
   [Expand]TemplatedBarManagerController Class
   [Expand]ToolBarControl Class
   [Expand]ToolBarControlBase Class
   [Expand]ToolbarListItem Class
   [Expand]ToolbarListItemLink Class
    ToolbarListItemType Enumeration
    ToolBarMergeStyle Enumeration
   [Expand]UpdateAction Class
   [Expand]UpdateBarAction Class
   [Expand]UpdateBarItemAction Class
   [Expand]UpdateBarItemLinkAction Class
   [Expand]UpdateBarItemLinkActionBase Class
  [Expand]DevExpress.Xpf.Carousel
  [Expand]DevExpress.Xpf.Charts
  [Expand]DevExpress.Xpf.Charts.Localization
  [Expand]DevExpress.Xpf.Charts.RangeControlClient
  [Expand]DevExpress.Xpf.ChunkList
  [Expand]DevExpress.Xpf.Controls
  [Expand]DevExpress.Xpf.Core
  [Expand]DevExpress.Xpf.Core.ConditionalFormatting
  [Expand]DevExpress.Xpf.Core.DataSources
  [Expand]DevExpress.Xpf.Core.ServerMode
  [Expand]DevExpress.Xpf.Data
  [Expand]DevExpress.Xpf.DataAccess
  [Expand]DevExpress.Xpf.DataAccess.DataSourceWizard
  [Expand]DevExpress.Xpf.Diagram
  [Expand]DevExpress.Xpf.Docking
  [Expand]DevExpress.Xpf.Docking.Base
  [Expand]DevExpress.Xpf.DocumentViewer
  [Expand]DevExpress.Xpf.Editors
  [Expand]DevExpress.Xpf.Editors.DateNavigator
  [Expand]DevExpress.Xpf.Editors.ExpressionEditor
  [Expand]DevExpress.Xpf.Editors.Filtering
  [Expand]DevExpress.Xpf.Editors.Flyout
  [Expand]DevExpress.Xpf.Editors.Flyout.Native
  [Expand]DevExpress.Xpf.Editors.Helpers
  [Expand]DevExpress.Xpf.Editors.Popups
  [Expand]DevExpress.Xpf.Editors.RangeControl
  [Expand]DevExpress.Xpf.Editors.Settings
  [Expand]DevExpress.Xpf.Editors.Validation
  [Expand]DevExpress.Xpf.Gauges
  [Expand]DevExpress.Xpf.Gauges.Localization
  [Expand]DevExpress.Xpf.Grid
  [Expand]DevExpress.Xpf.Grid.ConditionalFormatting
  [Expand]DevExpress.Xpf.Grid.LookUp
  [Expand]DevExpress.Xpf.Grid.TreeList
  [Expand]DevExpress.Xpf.Layout.Core
  [Expand]DevExpress.Xpf.LayoutControl
  [Expand]DevExpress.Xpf.Map
  [Expand]DevExpress.Xpf.NavBar
  [Expand]DevExpress.Xpf.Navigation
  [Expand]DevExpress.Xpf.PdfViewer
  [Expand]DevExpress.Xpf.PivotGrid
  [Expand]DevExpress.Xpf.PivotGrid.Printing
  [Expand]DevExpress.Xpf.Printing
  [Expand]DevExpress.Xpf.Printing.Parameters
  [Expand]DevExpress.Xpf.Printing.Parameters.Models
  [Expand]DevExpress.Xpf.Printing.PreviewControl.Bars
  [Expand]DevExpress.Xpf.Prism
  [Expand]DevExpress.Xpf.PropertyGrid
  [Expand]DevExpress.Xpf.Reports.UserDesigner
  [Expand]DevExpress.Xpf.Reports.UserDesigner.Extensions
  [Expand]DevExpress.Xpf.Reports.UserDesigner.Localization
  [Expand]DevExpress.Xpf.Reports.UserDesigner.ReportWizard
  [Expand]DevExpress.Xpf.Reports.UserDesigner.ReportWizard.Pages
  [Expand]DevExpress.Xpf.Ribbon
  [Expand]DevExpress.Xpf.RichEdit
  [Expand]DevExpress.Xpf.Scheduler
  [Expand]DevExpress.Xpf.Scheduler.Drawing
  [Expand]DevExpress.Xpf.Scheduler.Menu
  [Expand]DevExpress.Xpf.Scheduler.Reporting
  [Expand]DevExpress.Xpf.Scheduler.UI
  [Expand]DevExpress.Xpf.SpellChecker
  [Expand]DevExpress.Xpf.Spreadsheet
  [Expand]DevExpress.Xpf.Spreadsheet.Menu
  [Expand]DevExpress.Xpf.TreeMap
  [Expand]DevExpress.Xpf.Utils.Themes
  [Expand]DevExpress.Xpf.WindowsUI
  [Expand]DevExpress.Xpf.WindowsUI.Navigation
  [Expand]DevExpress.XtraRichEdit
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

BarManager Class

A container for bar containers that manages operations on bars and popup menus.

Namespace:DevExpress.Xpf.Bars
Assembly:DevExpress.Xpf.Core.v17.1.dll

Expanded Syntax

Expanded Remarks

For a window to support the Bars functionality, you can use one of the following approaches (or combine them based on your requirements)

To create the Bars UI using the BarManager component, do the following:

  1. Create bars and add them to the Bars collection.
  2. Create bar items, representing various commands, editors, static text, etc., and add them to the Items collection.
  3. Add the required bar items to a bar's BarItemLinkHolderBase.ItemLinks collection. When adding a bar item to this collection, a bar item link is created referring to this bar item, and it's added to the collection instead. You can add a single bar item to multiple bars, sub-menus and menus.
  4. To allow bars to be docked to the window, create a bar container(s) (a BarContainerControl object), which is a visual object. This can be performed either implicitly via the CreateStandardLayout property, or manually.
  5. To dock a bar to a bar container, bind the bar to the container via the Bar.DockInfo property. See the BarContainerControl topic to learn more.
  6. To make a bar floating, set the bar's Bar.DockInfo.ContainerType property to Floating.

    There is no need to create bar containers to allow bars to be floating. Bar containers are only required to dock a bar to the window.

Expanded Example

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E1537.

This example shows how to create three bars (File, Edit and StatusBar) using the BarManager component. Actions for bar elements are defined by commands implemented in the MyViewModel class.


 


The window's DataContext is set to a MyViewModel class descendant, which is automatically generated by the DevExpress.Mvvm.POCO.ViewModelSource object. This descendant automatically generates commands for all public methods in the MyViewModel class (the OpenFileCommand, NewFileCommand and SetAlignmentCommand are generated).

The result is shown below:

Expanded Inheritance Hierarchy

System.Object
    System.Windows.Threading.DispatcherObject
       System.Windows.DependencyObject
          System.Windows.Media.Visual
             System.Windows.UIElement
                System.Windows.FrameworkElement
                   System.Windows.Controls.Decorator
                      BarManager

Expanded See Also

How would you rate this topic?​​​​​​​