# DXSerializer Events - Advanced Scenarios | WPF Controls | DevExpress Documentation

This topic describes advanced use cases of the [DXSerializer](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer)‘s events.

## Serialize/Deserialize Custom Properties of a DevExpress WPF Control Descendant

### Requirements that Custom Properties Must Meet to be Saved/Restored

1. Mark the property with the `[XtraSerializableProperty]` attribute.

     In the [GridControl](/WPF/DevExpress.Xpf.Grid.GridControl)‘s descendants, you should also assign one of the following attributes to the property:

    - The `[GridUIProperty]` attribute to save/restore a custom property when the [DXSerializer.StoreLayoutMode](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode) is [UI](/WPF/DevExpress.Xpf.Core.Serialization.StoreLayoutMode).
    - The `[GridStoreAlwaysProperty]` attribute to save/restore a custom property when the [DXSerializer.StoreLayoutMode](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode) is [None](/WPF/DevExpress.Xpf.Core.Serialization.StoreLayoutMode).
2. If your property is a dependency property, specify its local value.

### Example

The following code sample saves/restores the `MyCustomProperty` dependency property value:

- XAML

<section id="tabpanel_aWr0sWxSt9_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;}" data-highlight-lines="[[7]]" class="lang-xaml">&lt;Window
    xmlns:dx=&quot;http://schemas.devexpress.com/winfx/2008/xaml/core&quot;
    xmlns:local=&quot;clr-namespace:GridSerialization&quot;
    xmlns:dxg=&quot;http://schemas.devexpress.com/winfx/2008/xaml/grid&quot;
    x:Class=&quot;GridSerialization.MainWindow&quot;&gt;
    &lt;StackPanel&gt;
        &lt;local:GridControlEx dx:DXSerializer.StoreLayoutMode=&quot;UI&quot; x:Name=&quot;grid&quot; MyCustomProperty=&quot;15&quot;&gt;
            &lt;dxg:GridControl.View&gt;
                &lt;dxg:TableView/&gt;
            &lt;/dxg:GridControl.View&gt;
        &lt;/local:GridControlEx&gt;
    &lt;/StackPanel&gt;
&lt;/Window&gt;
</code></pre></section>

- C#
- VB.NET

<section id="tabpanel_aWr0sWxSt9-1_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;}" data-highlight-lines="[[8],[10,12]]" class="lang-csharp">using DevExpress.Utils.Serializing;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Core.Serialization;

public class GridControlEx : GridControl {

    public static DependencyProperty MyCustomPropertyProperty =
        DependencyProperty.Register(&quot;MyCustomProperty&quot;, typeof(int), typeof(GridControlEx));

    [XtraSerializableProperty]
    [GridStoreAlwaysProperty]
    public int MyCustomProperty {
        get =&gt; (int)GetValue(MyCustomPropertyProperty);
        set =&gt; SetValue(MyCustomPropertyProperty, value);
    }
}
</code></pre></section>
<section id="tabpanel_aWr0sWxSt9-1_tabid-vb" role="tabpanel" data-tab="tabid-vb" aria-hidden="true" hidden="hidden">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;}" class="lang-vb">Imports DevExpress.Utils.Serializing
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core.Serialization

Public Class GridControlEx
    Inherits GridControl

    Public Shared MyCustomPropertyProperty As DependencyProperty = DependencyProperty.Register(&quot;MyCustomProperty&quot;, GetType(Integer), GetType(GridControlEx))

    &lt;XtraSerializableProperty&gt;
    &lt;GridStoreAlwaysProperty&gt;
    Public Property MyCustomProperty As Integer
        Get
            Return CInt(GetValue(MyCustomPropertyProperty))
        End Get
        Set(ByVal value As Integer)
            Return SetValue(MyCustomPropertyProperty, value)
        End Set
    End Property
End Class
</code></pre></section>

## Serialize Custom Attached Properties

To serialize a custom attached property, mark the property’s **Get** method with the `[XtraSerializableProperty]` attribute.

- C#
- VB.NET

<section id="tabpanel_aWr0sWxSt9-2_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;}" data-highlight-lines="[[2],[4,5]]" class="lang-csharp">public static readonly DependencyProperty IsCheckedProperty =
    DependencyProperty.RegisterAttached(&quot;IsChecked&quot;, typeof(bool), typeof(GridControlEx), new PropertyMetadata(false));

[XtraSerializableProperty]
public static bool GetIsChecked(DependencyObject obj) {
    return (bool)obj.GetValue(IsCheckedProperty);
}
public static void SetIsChecked(DependencyObject obj, bool value) {
    obj.SetValue(IsCheckedProperty, value);
}
</code></pre></section>
<section id="tabpanel_aWr0sWxSt9-2_tabid-vb" role="tabpanel" data-tab="tabid-vb" aria-hidden="true" hidden="hidden">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;}" class="lang-vb">Public Shared ReadOnly IsCheckedProperty As DependencyProperty = DependencyProperty.RegisterAttached(&quot;IsChecked&quot;, GetType(Boolean), GetType(GridControlEx), New PropertyMetadata(False))

&lt;XtraSerializableProperty&gt;
Public Shared Function GetIsChecked(ByVal obj As DependencyObject) As Boolean
    Return CBool(obj.GetValue(IsCheckedProperty))
End Function

Public Shared Sub SetIsChecked(ByVal obj As DependencyObject, ByVal value As Boolean)
    obj.SetValue(IsCheckedProperty, value)
End Sub
</code></pre></section>

## Serialize Standard and Custom Controls

To save/restore properties of custom and standard controls, do the following:

1. Specify the [SerializationID](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.SerializationID) property for a control whose layout you want to save/restore.
2. Mark the control’s properties whose values you want to save/restore with the `[XtraSerializableProperty]` attribute.
3. Do one of the following:
    - Pass properties to the [DXSerializer.AddCustomGetSerializablePropertiesHandler](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AddCustomGetSerializablePropertiesHandler%28DependencyObject--CustomGetSerializablePropertiesEventHandler%29) method.
    - Handle the [CustomGetSerializableProperties](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties) event and pass properties to the
[CustomGetSerializablePropertiesEventArgs.SetPropertySerializable](/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable.overloads) method.

## Do not Restore a Control’s Predefined Property

Do the following to prevent a property from deserialization:

1. Handle the [AllowProperty](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty) event.
2. Set the [AllowPropertyEventArgs.Allow](/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventArgs.Allow) property to `false`.

You can use `AllowPropertyEventArgs.Property` to get a deserialized property.

The following code sample disables the deserialization operation for the [GridControl](/WPF/DevExpress.Xpf.Grid.GridControl) column’s [WidthProperty](/WPF/DevExpress.Xpf.Grid.BaseColumn.WidthProperty):

- MainWindow.xaml.cs
- MainWindow.xaml.vb

<section id="tabpanel_aWr0sWxSt9-3_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;}" data-highlight-lines="[[8,9],[14]]" class="lang-csharp">using DevExpress.Xpf.Core.Serialization;
using DevExpress.Xpf.Grid;
// ...

public partial class MainWindow : Window {
    public MainWindow() {
        //...
        grid.Columns[nameof(Customer.ID)].AddHandler(DXSerializer.AllowPropertyEvent, 
              new AllowPropertyEventHandler(OnAllowProperty));
    }

    void OnAllowProperty(object sender, AllowPropertyEventArgs e) {
        if (e.DependencyProperty == GridColumn.WidthProperty)
            e.Allow = false;
    }
}
</code></pre></section>
<section id="tabpanel_aWr0sWxSt9-3_tabid-vb" role="tabpanel" data-tab="tabid-vb" aria-hidden="true" hidden="hidden">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;}" data-highlight-lines="[[10,11],[15]]" class="lang-vb">Imports DevExpress.Xpf.Core.Serialization
Imports DevExpress.Xpf.Grid
&#39;...

Public Partial Class MainWindow
    Inherits Window

    Public Sub New()
        &#39; ...
        grid.Columns(NameOf(Customer.ID)).[AddHandler](DXSerializer.AllowPropertyEvent, 
            New AllowPropertyEventHandler(AddressOf OnAllowProperty))
    End Sub

    Private Sub OnAllowProperty(ByVal sender As Object, ByVal e As AllowPropertyEventArgs)
        If e.DependencyProperty = GridColumn.WidthProperty Then e.Allow = False
    End Sub
End Class
</code></pre></section>

[View Example: Do not serialize a GridControl's properties](https://github.com/DevExpress-Examples/how-to-prevent-certain-gridcontrols-properties-from-being-serialized-t158989)

## Stop Layout Restore (Deserialization)

1. Handle the [BeforeLoadLayout](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout) event.
2. Set the [BeforeLoadLayoutEventArgs.Allow](/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventArgs.Allow) event argument to `false`.

The following code sample disables the [GridControl](/WPF/DevExpress.Xpf.Grid.GridControl)‘s property deserialization if the layout version is not `1.48`: 

- MainWindow.xaml.cs
- MainWindow.xaml.vb

<section id="tabpanel_aWr0sWxSt9-4_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core&quot;}" class="lang-csharp">using DevExpress.Utils.Serializing;
using DevExpress.Xpf.Core.Serialization;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Core;
// ...

public partial class MainWindow : Window {
    public MainWindow() {
        //...
        grid.AddHandler(DXSerializer.BeforeLoadLayoutEvent, new BeforeLoadLayoutEventHandler(BeforeLoadLayoutHandler));
    }

    void BeforeLoadLayoutHandler(object sender, BeforeLoadLayoutEventArgs e) {
        if (e.RestoredVersion != &quot;1.48&quot;) {
               e.Allow = false;
        }
    }
}
</code></pre></section>
<section id="tabpanel_aWr0sWxSt9-4_tabid-vb" role="tabpanel" data-tab="tabid-vb" aria-hidden="true" hidden="hidden">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core&quot;}" class="lang-vb">Imports DevExpress.Utils.Serializing
Imports DevExpress.Xpf.Core.Serialization
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
&#39;...

Public Partial Class MainWindow
    Inherits Window

    Public Sub New()
        InitializeComponent()
        Me.DataContext = Me
        grid.[AddHandler](DXSerializer.BeforeLoadLayoutEvent, New BeforeLoadLayoutEventHandler(AddressOf BeforeLoadLayoutHandler))
    End Sub

    Sub BeforeLoadLayoutHandler(ByVal sender As Object, ByVal e As BeforeLoadLayoutEventArgs)
        e.Allow = False
    End Sub
End Class
</code></pre></section>

## Restore Items From a Saved (Serialized) Collection

1. Handle the [CreateCollectionItem](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CreateCollectionItemEvent) event.
2. Create an instance of the collection object that you want to restore.
3. Add the created instance to the **e.Collection** event argument.
4. Set the **e.CollectionItem** to the created object’s instance.

For example, the GridControl handles this event to restore columns, summary items, MRU filters, and so on.

This event is raised if a property is marked with the `[XtraSerializableProperty]` attribute. The `XtraSerializableProperty.XtraSerializationVisibility` property must be set to `XtraSerializationVisibility.Collection` and the `XtraSerializableProperty.UseCreateItem` property should be set to `true`.

- C#
- VB.NET

<section id="tabpanel_aWr0sWxSt9-5_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core&quot;}" data-highlight-lines="[[21],[13,18],[31]]" class="lang-csharp">using DevExpress.Utils.Serializing;
using DevExpress.Xpf.Core.Serialization;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Core;
// ...

public partial class MainWindow : Window {
    public MainWindow() {
        //...
        grid.Columns[&quot;Name&quot;].AddHandler(DXSerializer.CreateCollectionItemEvent, new XtraCreateCollectionItemEventHandler(OnCreateCollectionItem));
    }

    void OnCreateCollectionItem(object sender, XtraCreateCollectionItemEventArgs e) {
        if (e.CollectionName == nameof(MyGridColumn.SomeCollection)) {
            CustomObject item = new CustomObject();
            ((ObservableCollection&lt;CustomObject&gt;)e.Collection).Add(item);
            e.CollectionItem = item;
        }
    }

    public class MyGridColumn : GridColumn {
        [XtraSerializableProperty(XtraSerializationVisibility.Collection, true, false, true)]
        public ObservableCollection&lt;CustomObject&gt; SomeCollection {
            get { return (ObservableCollection&lt;CustomObject&gt;)GetValue(SomeCollectionProperty); }
            set { SetValue(SomeCollectionProperty, value); }
        }

        public static readonly DependencyProperty SomeCollectionProperty = DependencyProperty.Register(&quot;SomeCollection&quot;, typeof(ObservableCollection&lt;CustomObject&gt;), typeof(MyGridColumn), null);
    }   

     public class CustomObject : INotifyPropertyChanged {
        string itemID;
        string itemValue;
        [XtraSerializableProperty]
        public string ItemID {
            get {
                return itemID;
            }
            set {
                itemID = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs(&quot;ItemID&quot;));
            }
        }
        [XtraSerializableProperty]
        public string ItemValue {
            get {
                return itemValue;
            }
            set {
                itemValue = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs(&quot;PropertyB&quot;));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        public void RaisePropertyChanged(string propertyName) {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
    public class Customer {
        public int ID {
            get;
            set;
        }
        public string Name {
            get;
            set;
        }
    }
}
</code></pre></section>
<section id="tabpanel_aWr0sWxSt9-5_tabid-vb" role="tabpanel" data-tab="tabid-vb" aria-hidden="true" hidden="hidden">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core&quot;}" class="lang-vb">Imports DevExpress.Utils.Serializing
Imports DevExpress.Xpf.Core.Serialization
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core

Public Partial Class MainWindow
    Inherits Window

    Public Sub New()
        grid.Columns(&quot;Name&quot;).[AddHandler](DXSerializer.CreateCollectionItemEvent, New XtraCreateCollectionItemEventHandler(AddressOf OnCreateCollectionItem))
    End Sub

    Private Sub OnCreateCollectionItem(ByVal sender As Object, ByVal e As XtraCreateCollectionItemEventArgs)
        Dim item As CustomObject = New CustomObject()
        (CType(e.Collection, ObservableCollection(Of CustomObject))).Add(item)
        e.CollectionItem = item
    End Sub
End Class
</code></pre></section>

## Save Controls that do not Exist in the Visual Tree

1. Handle the [CustomGetSerializableChildren](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildren) event.
2. Add a control whose layout you want to save to the [CustomGetSerializableChildrenEventArgs.Children](/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children) collection.

If a [LayoutPanel](/WPF/DevExpress.Xpf.Docking.LayoutPanel) contains a UserControl with a [GridControl](/WPF/DevExpress.Xpf.Grid.GridControl) and this panel is not activated, the [GridControl](/WPF/DevExpress.Xpf.Grid.GridControl) does not exist in the visual tree and its properties are not saved (serialized). To save a [GridControl](/WPF/DevExpress.Xpf.Grid.GridControl)‘s properties, add the [GridControl](/WPF/DevExpress.Xpf.Grid.GridControl) to the [CustomGetSerializableChildrenEventArgs.Children](/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children) collection.

- MainWindow.xaml.cs
- MainWindow.xaml.vb

<section id="tabpanel_aWr0sWxSt9-6_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core&quot;,&quot;/ (DevExpress.Xpf.Docking)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Docking&quot;}" data-highlight-lines="[[11],[15]]" class="lang-csharp">using DevExpress.Utils.Serializing;
using DevExpress.Xpf.Core.Serialization;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Core;
using DevExpress.Xpf.Docking;
// ...

public partial class MainWindow : Window {
    public MainWindow() {
        //...
        layoutPanel.AddHandler(DXSerializer.CustomGetSerializableChildrenEvent, new CustomGetSerializableChildrenEventHandler(CustomGetSerializableChildrenEventHandler));
    }
    ///...
    void OnCreateContentPropertyValue(object sender, XtraCreateContentPropertyValueEventArgs e) {
        e.Children.Add(grid);
    }
}
</code></pre></section>
<section id="tabpanel_aWr0sWxSt9-6_tabid-vb" role="tabpanel" data-tab="tabid-vb" aria-hidden="true" hidden="hidden">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core&quot;,&quot;/ (DevExpress.Xpf.Docking)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Docking&quot;}" class="lang-vb">Imports DevExpress.Utils.Serializing
Imports DevExpress.Xpf.Core.Serialization
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
Imports DevExpress.Xpf.Docking
&#39;...
Public Partial Class MainWindow
    Inherits Window

    Public Sub New()
        &#39;...
        layoutPanel.[AddHandler](DXSerializer.CustomGetSerializableChildrenEvent, New CustomGetSerializableChildrenEventHandler(CustomGetSerializableChildrenEventHandler))
    End Sub
    &#39;...
    Sub OnCreateContentPropertyValue(ByVal sender As Object, ByVal e As XtraCreateContentPropertyValueEventArgs)
        e.Children.Add(grid)
    End Sub
End Class
</code></pre></section>

## Serialize Properties that are not Marked with the XtraSerializablePropertyAttribute

1. Handle the [CustomGetSerializableProperties](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties) event.
2. Pass the property whose value you want to save/restore to the
[CustomGetSerializablePropertiesEventArgs.SetPropertySerializable](/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable.overloads) method.

The following code sample saves (serializes) the [GridColumn.Tag](/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag) property:

- C#
- VB.NET

<section id="tabpanel_aWr0sWxSt9-7_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core&quot;}" data-highlight-lines="[[9],[13]]" class="lang-csharp">using DevExpress.Utils.Serializing;
using DevExpress.Xpf.Core.Serialization;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Core;
//...
public partial class MainWindow : Window {
    public MainWindow() {
        //...
        grid.AddHandler(DXSerializer.CustomGetSerializablePropertiesEvent, new CustomGetSerializablePropertiesEventHandler(CustomGetSerializablePropertiesHandler));
    }

    void CustomGetSerializablePropertiesHandler(object sender, CustomGetSerializablePropertiesEventArgs e) {
        e.SetPropertySerializable(GridColumn.TagProperty, new DXSerializable() { });
    }
}
</code></pre></section>
<section id="tabpanel_aWr0sWxSt9-7_tabid-vb" role="tabpanel" data-tab="tabid-vb" aria-hidden="true" hidden="hidden">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;,&quot;/ (DevExpress.Utils.Serializing)(?:;|$)/&quot;:&quot;/CoreLibraries/DevExpress.Utils.Serializing&quot;,&quot;/ (DevExpress.Xpf.Core.Serialization)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization&quot;,&quot;/ (DevExpress.Xpf.Grid)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Grid&quot;,&quot;/ (DevExpress.Xpf.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Core&quot;}" class="lang-vb">Imports DevExpress.Utils.Serializing
Imports DevExpress.Xpf.Core.Serialization
Imports DevExpress.Xpf.Grid
Imports DevExpress.Xpf.Core
&#39;...

Public Partial Class MainWindow
    Inherits Window

    Public Sub New()
        InitializeComponent()
        Me.DataContext = Me
        grid.[AddHandler](DXSerializer.CustomGetSerializablePropertiesEvent, New CustomGetSerializablePropertiesEventHandler(CustomGetSerializablePropertiesHandler))
    End Sub

    Sub CustomGetSerializablePropertiesHandler(ByVal sender As Object, ByVal e As CustomGetSerializablePropertiesEventArgs)
        e.SetPropertySerializable(GridColumn.TagProperty, New DXSerializable())
    End Sub
End Class
</code></pre></section>

## Update Layout Between Different Versions of Your Application

Do the following to update your application’s layout in a newer application version:

1. Specify or increment the [DXSerializer.LayoutVersion](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.LayoutVersion) attached property value. This property is the version of your application’s layout.
2. Change your application’s layout.
3. If the [DXSerializer.LayoutVersion](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.LayoutVersion) attached property value of your application is lower than the new property value, the [LayoutUpgrade](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.LayoutUpgrade) event is fired.

[View Example: How to use the LayoutUpgrade event to upgrade a layout from one version to another](https://github.com/DevExpress-Examples/wpf-dock-layout-manager-upgrade-layouts-between-versions)

Note

The DXSerializer.AddXXXHandler methods work only for UIElements. If an element is a FrameworkContentElement descendant, use the standard AddHandler method.

## Create a Custom Property Deserialization Handler

The [DeserializeProperty](/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty) event occurs when a property is deserialized. You can use `XtraPropertyInfoEventArgs.Name`/`XtraPropertyInfoEventArgs.DependencyProperty` to get a name of a property/dependency property.

- XAML

<section id="tabpanel_aWr0sWxSt9-8_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;}" data-highlight-lines="[[6]]" class="lang-xaml">&lt;Window ...
    xmlns:dx=&quot;http://schemas.devexpress.com/winfx/2008/xaml/core&quot;
    xmlns:dxg=&quot;http://schemas.devexpress.com/winfx/2008/xaml/grid&quot;&gt;
    &lt;DockPanel&gt;
        &lt;!-- ... --&gt;
        &lt;dxg:GridControl x:Name=&quot;grid&quot;  dx:DXSerializer.DeserializeProperty=&quot;grid_DeserializeProperty&quot;&gt;
            &lt;!-- ... --&gt;
        &lt;/dxg:GridControl&gt;
    &lt;/DockPanel&gt;
&lt;/Window&gt;
</code></pre></section>

- C#
- VB.NET

<section id="tabpanel_aWr0sWxSt9-9_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;}" data-highlight-lines="[[3]]" class="lang-csharp">private void grid_DeserializeProperty(object sender, DevExpress.Xpf.Core.Serialization.XtraPropertyInfoEventArgs e) {
    if (e.DependencyProperty == ColumnBase.VisibleProperty) {
        e.Handled = true;
        // ...
    }
}
</code></pre></section>
<section id="tabpanel_aWr0sWxSt9-9_tabid-vb" role="tabpanel" data-tab="tabid-vb" aria-hidden="true" hidden="hidden">
<pre><code data-code-links="{&quot;StoreLayoutMode&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.StoreLayoutMode&quot;,&quot;AllowPropertyEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.AllowProperty&quot;,&quot;AllowPropertyEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.AllowPropertyEventHandler&quot;,&quot;BeforeLoadLayoutEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.BeforeLoadLayout&quot;,&quot;BeforeLoadLayoutEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.BeforeLoadLayoutEventHandler&quot;,&quot;e.Children&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventArgs.Children&quot;,&quot;CustomGetSerializableChildrenEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableChildrenEvent&quot;,&quot;CustomGetSerializableChildrenEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializableChildrenEventHandler&quot;,&quot;CustomGetSerializablePropertiesEvent&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.CustomGetSerializableProperties&quot;,&quot;CustomGetSerializablePropertiesEventHandler&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventHandler&quot;,&quot;e.SetPropertySerializable&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.CustomGetSerializablePropertiesEventArgs.SetPropertySerializable(System.String-DevExpress.Xpf.Core.Serialization.DXSerializable)&quot;,&quot;GridColumn.TagProperty&quot;:&quot;/WPF/DevExpress.Xpf.Grid.ColumnBase.Tag&quot;,&quot;DeserializeProperty&quot;:&quot;/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.DeserializeProperty&quot;}" class="lang-vb">Private Sub grid_DeserializeProperty(ByVal sender As Object, ByVal e As DevExpress.Xpf.Core.Serialization.XtraPropertyInfoEventArgs)
    If e.DependencyProperty = ColumnBase.VisibleProperty Then
        e.Handled = True
        &#39;...
    End If
End Sub
</code></pre></section>