Back to Devexpress

WorkspaceManager.PropertyDeserializing Event

windowsforms-devexpress-dot-utils-dot-workspacemanager-1528f3c6.md

latest2.3 KB
Original Source

WorkspaceManager.PropertyDeserializing Event

Occurs whenever a property is about to be restored from a workspace.

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

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

Declaration

csharp
[DXCategory("Behavior")]
public event PropertyCancelEventHandler PropertyDeserializing
vb
<DXCategory("Behavior")>
Public Event PropertyDeserializing As PropertyCancelEventHandler

Event Data

The PropertyDeserializing event's data class is DevExpress.Utils.PropertyCancelEventArgs.

Remarks

Arguments for the PropertyDeserializing event provide the Owner and PropertyName properties to identify what settings are being restored and what controls they belong to. The Cancel property allows you to skip restoring the desired property. By doing so, you can selectively deserialize properties, applying only those that are needed.

csharp
void workspaceManager1_PropertyDeserializing(object sender, DevExpress.Utils.PropertyCancelEventArgs ea) {
    GridView view = ea.Owner as GridView;
    if (view != null && view == gridView1) {
        ea.Cancel = ea.PropertyName == "MultiSelect";
    }
}
vb
Sub WorkspaceManager1_PropertyDeserializing(sender As Object, ea As DevExpress.Utils.PropertyCancelEventArgs) Handles WorkspaceManager1.PropertyDeserializing
    Dim view As GridView = TryCast(ea.Owner, GridView)
    If Not view Is Nothing AndAlso view Is GridView1 Then
        ea.Cancel = ea.PropertyName = "MultiSelect"
    End If
End Sub

See Also

PropertySerializing

WorkspaceManager Class

WorkspaceManager Members

DevExpress.Utils Namespace