Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WorkspaceManager.BeforeApplyWorkspace Event

Fires before the Workspace Manager applies a new workspace.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v24.2.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