Save and Restore Layout
- 2 minutes to read
You can save the NavBar control’s layout into a number of storage medias and restore it later. This allows you to:
- provide layout persistence between application runs;
- automatically switch between the predefined layouts;
- allow end-users to load different layouts according to their needs;
- share layouts between different controls in one or different applications, etc.
Refer to this article to learn how to save and restore the control’s layout in code. At design-time, you can utilize the “Layout” tab of the Navigation Bar Designer.
Note
To allow a layout to be correctly saved and restored, ensure that all nav bar groups and items created at runtime have their names (the Name property) specified.
Important
Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.
API
Member | Description |
---|---|
NavBarControl.SaveToRegistry | Saves the control’s layout to the specified system registry path. |
NavBarControl.SaveToStream | Saves the control’s layout to a stream. |
NavBarControl.SaveToXml | Saves a control’s layout to a specified XML file. |
NavBarControl.RestoreFromRegistry | Restores the control layout stored at a specified system registry path. |
NavBarControl.RestoreFromStream | Loads a control’s layout from a stream. |
NavBarControl.RestoreFromXml | Loads a control’s layout from a specified XML file. |
NavBarControl.LayoutVersion | Gets or sets the version of the control’s layout. |
NavBarControl.LayoutUpgrade | Occurs after a layout whose version doesn’t match the current layout version has been loaded from a stream, xml file or system registry. |