Skip to main content

WorkspaceManager Class

Manages layouts of all DevExpress controls in the application as one global workspace. Workspaces can be saved and restored to (from) a local storage or stream.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core


public class WorkspaceManager :


The WorkspaceManager is designed to simplify manipulating layouts of DevExpress controls. You can create multiple layouts for visual controls in advance, and then use the WorkspaceManager to instantly switch between them at runtime. To learn more, see Workspace Manager.

Each WorkspaceManager instance is associated with a particular visual control (target control). To create a WorkspaceManager, set the WorkspaceManager.IsEnabled attached property for a visual control to true. A new WorkspaceManager instance will be created and associated with this control. You can now obtain the WorkspaceManager via the WorkspaceManager.WorkspaceManager attached property.

The WorkspaceManager manipulates layouts of the target control and its child controls, so it stores each layout of the target control together with the corresponding layouts of the child controls, arranged into a workspace. Workspaces are identified by their names and stored in the WorkspaceManager.Workspaces collection. A new workspace can be created by capturing the current state of the target control via the WorkspaceManager.CaptureWorkspace method. To apply a previously captured workspace, use the WorkspaceManager.ApplyWorkspace method. The workspaces can be saved to a file or stream using the WorkspaceManager.SaveWorkspace method, and then loaded again with the WorkspaceManager.LoadWorkspace method.

You can also use the WorkspaceManager.TransitionEffect property to specify a visual effect applied when switching between workspaces.

The WorkspaceManager fires the WorkspaceManager.BeforeApplyWorkspace event after the WorkspaceManager.ApplyWorkspace method has been called, before it applies a workspace. After the WorkspaceManager.ApplyWorkspace method has applied the workspace, the WorkspaceManager.AfterApplyWorkspace event occurs.



See Also