windowsforms-devexpress-dot-utils-dot-workspacemanager-14fac570.md
Fires before the Workspace Manager applies a new workspace.
Namespace : DevExpress.Utils
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
[DXCategory("Behavior")]
public event EventHandler BeforeApplyWorkspace
<DXCategory("Behavior")>
Public Event BeforeApplyWorkspace As EventHandler
The BeforeApplyWorkspace event's data class is EventArgs.
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.
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;
// ...
}
Imports DevExpress.Utils
Private Sub workspaceManager1_BeforeApplyWorkspace(ByVal sender As Object, ByVal e As EventArgs)
Dim workspaceName As String = (TryCast(e, WorkspaceEventArgs)).Workspace.Name
' ...
End Sub
See Also