Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Expand]Data Grid
  [Collapse]Ribbon, Bars and Menu
   [Expand]Common Features
   [Collapse]Bars
    [Expand]Getting Started
    [Expand]Bar Layout
    [Expand]Populating Bars
     Bar Actions
    [Expand]Runtime Customization
    [Expand]Examples
     Saving and Restoring a Bar Layout
   [Expand]Ribbon
   [Expand]Menus
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Saving and Restoring a Bar Layout

A bar layout can be saved to a data store (an XML file or a stream), and then restored from this data store, overriding the changes made since the layout was saved. This document provides information on this topic.

Expanded Saving and Restoring a Bar Layout

The BarManager provides methods to save and restore a bar layout and bar items that belong to the BarManager:

You can save the layout of multiple DevExpress visual controls residing in a single object (e.g., window) in a centralized way, using the functionality provided by the DevExpress.Xpf.Core.Serialization.DXSerializer class. See Saving and Restoring Layout Basics, to learn more.

To save the layout of a control when a window is about to close, handle the Window.Closing event. To restore the layout when the window is being loaded, handle the Window.Loaded event.

Note

To serialize the layout of Standalone Bar Controls, place them inside a BarManager.

Expanded Example

The following code saves and restores the layout of bars and bar items that belong to a BarManager:

Expanded See Also

Is this topic helpful?​​​​​​​