Skip to main content

WorkspaceManager.BeforeApplyWorkspace Event

Fires before the Workspace Manager applies a new workspace.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v24.1.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

Declaration

[DXCategory("Behavior")]
public event EventHandler BeforeApplyWorkspace

Event Data

The BeforeApplyWorkspace event's data class is EventArgs.

Remarks

The Workspace Manager fires the BeforeApplyWorkspace event when a user applies a new workspace or when you call the ApplyWorkspace(String) method. Once the workspace is applied, the Workspace Manager fires the WorkspaceManager.AfterApplyWorkspace event.

Example

The following example demonstrates how to obtain the name of a workspace before it is applied. Typecast the default event args to WorkspaceEventArgs and use the Workspace property to obtain the workspace.

using DevExpress.Utils;

private void workspaceManager1_BeforeApplyWorkspace(object sender, EventArgs e) {
    string workspaceName = (e as WorkspaceEventArgs).Workspace.Name;
    // ...
}
See Also