Skip to main content
All docs
V24.2

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

ValueFactoryExtension.ValueTemplate Property

Gets or sets the template that contains the created object instance.

Namespace: DevExpress.Mvvm.UI

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

NuGet Package: DevExpress.Wpf.Core

#Declaration

public DataTemplate ValueTemplate { get; set; }

#Property Value

Type Description
DataTemplate

The template that contains the created object instance.

#Remarks

Since the ValueTemplate is the ValueFactoryExtension‘s content property, you can use the following XAML markup:

<Window.Resources>
    <Style TargetType="dxg:GridControl" x:Key="gridStyle">
        <!-- ... -->
        <Setter Property="View">
            <Setter.Value>
                <dxmvvm:ValueFactory>
                    <DataTemplate>
                        <dxg:TreeListView KeyFieldName="ID" ParentFieldName="ParentID" 
                                          AutoWidth="True" AutoExpandAllNodes="True"/>
                    </DataTemplate>
                </dxmvvm:ValueFactory>
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources>
See Also