Saving and Restoring Gauge Layout and Style Settings
- 2 minutes to read
Gauges, as well as many other DevExpress controls, support save/restore the layout feature. This feature gives you the ability to store different layout versions of your gauges and cycle through them when needed.
Using the GaugeControlBase class API, you can store gauge layouts in XML files, stream or registry.
When saving gauge layouts to a registry, you can define either whole or partial registry keys. For instance, the ‘Software\MyCompany\MyProject' partial key will result in saving settings to the ‘HKEY_CURRENT_USER\Software\MyCompany\MyProject' path. You can also specify the entire path if you need to store the layout at another root key (e.g., ‘HKEY_LOCAL_MACHINE\Software\MyCompany\MyProject'). These registry keys are passed to the GaugeControlBase.SaveLayoutToRegistry and GaugeControlBase.RestoreLayoutFromRegistry methods as parameters.
All these methods allow you to save and restore overall gauge layout settings: currently existing Visual Elements, their behavior and style settings. If you do not want your gauge layout to be affected, but rather wish to save and restore various style presets, use related Save(Restore)Style… methods instead. Same as with saving layouts, these methods allow you to save style settings to a local storage or stream, but do not allow you to save them to a registry.
Gauge paint styles can also be managed by the StyleController component.
Additionally to the methods mentioned above, you can utilize the Workspace Manager component. This component provides a centralized way to save layouts of all supported DevExpress controls in one global layout called workspace. This component allows you to create multiple predefined application workspaces that your users will be able to choose from, as well as save and restore their own custom workspaces.