Back to Devexpress

DXSerializer.Enabled Attached Property

wpf-devexpress-dot-xpf-dot-core-dot-serialization-dot-dxserializer-53453327.md

latest2.2 KB
Original Source

DXSerializer.Enabled Attached Property

Gets or sets whether the DXSerializer should serialize/deserialize properties of the control to which this property is specified. This is an attached property.

Namespace : DevExpress.Xpf.Core.Serialization

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

See GetEnabled(DependencyObject) and SetEnabled(DependencyObject, Boolean).

Returns

TypeDescription
Boolean

true , to enable serialization/deserialization of the specified control’s properties; otherwise, false.

|

Remarks

The following code sample enables a ThemedWindow‘s property serialization to an XML file:

xaml
<dx:ThemedWindow ...
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    x:Name="mainwindow"
    dx:DXSerializer.Enabled="True">
    <Grid>
        <Button Content="Save Layout" Click="Button_Click"/>
        <!-- ... -->
    </Grid>
    ...
</dx:ThemedWindow>
csharp
private void Button_Click(object sender, RoutedEventArgs e) {
    DXSerializer.Serialize(mainwindow, "windowlayout.xml");
}
vb
Private Sub Button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    DXSerializer.Serialize(mainwindow, "windowlayout.xml")
End Sub

See Also

DXSerializer Class

DXSerializer Members

DevExpress.Xpf.Core.Serialization Namespace