Skip to main content
Bar

BarManager.LayoutVersion Property

Gets or sets the version of the layout of bars.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual string LayoutVersion { get; set; }

Property Value

Type Description
String

A string representing the version of the layout of bars.

Remarks

You should assign versions to layouts if you need to customize the bar layout after a previous version of the layout has been loaded from a data store (a stream, xml file or system registry), and applied to the control.

Imagine that an earlier version of an application was released, and this contained the FILE menu consisting of two items (NEW and EXIT). When running the application an end-user saved the layout of bars to an XML file. Then a new version of the application was designed. For example, it added a new bar item (OPEN) to the FILE menu. By default, when the previously saved layout is loaded within the new application the current layout of the control will be overridden. Therefore the FILE menu will only contain two items (NEW and EXIT). The OPEN item will be removed from the FILE menu, although the corresponding bar item will not be disposed of.

To allow end-users to work with previously saved layouts and ensure that new features won’t be lost and new bar items will still be visible after old layouts have been loaded, you should do the following:

  • When designing a new version of the control’s layout set the version via the LayoutVersion property. Ensure that the version of the current control’s layout differs from that of the saved layouts.
  • Handle the BarManager.LayoutUpgrade event to implement a routine that will upgrade old layouts. This event occurs after a previously saved layout has been loaded, and only if its version doesn’t match the version of the current control’s layout. For the above example you could handle the LayoutUpgrade event to add the new bar item link (OPEN) at a specific position in the FILE menu.

The LayoutVersion property’s value is synchronized with the bar’s OptionsLayoutBase.LayoutVersion property’s value.

See Also