NoesisGUI

HierarchicalDataTemplate Class

Represents a DataTemplate that supports HeaderedItemsControl, such as TreeViewItem or MenuItem.

<Grid
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Grid.Resources>
        <LeagueList x:Key="items" />

        <HierarchicalDataTemplate DataType="League" ItemsSource="{Binding Path=Divisions}">
            <TextBlock Text="{Binding Path=Name}"/>
        </HierarchicalDataTemplate>

        <HierarchicalDataTemplate DataType="Division" ItemsSource="{Binding Path=Teams}">
            <TextBlock Text="{Binding Path=Name}"/>
        </HierarchicalDataTemplate>

        <DataTemplate DataType="Team">
            <TextBlock Text="{Binding Path=Name}"/>
        </DataTemplate>
    </Grid.Resources>

    <TreeView DataContext="{StaticResource items}">
        <TreeViewItem ItemsSource="{Binding Leagues}" Header="My Soccer Leagues" />
    </TreeView>

</Grid>

http://msdn.microsoft.com/en-us/library/system.windows.hierarchicaldatatemplate.aspx

Inheritance Hierarchy

HierarchicalDataTemplate

INDEX Class Hierarchy Index

Methods

From FrameworkTemplate

Name Description
Apply Applies current template to the element specified
CanSeal Indicates if the current instance can be sealed
FindName Finds the element associated with the specified name defined within this template
FindName Returns an object that has the provided identifying name
GetAvailableTriggers Gets template triggers if available
IsSealed Indicates if the current instance is sealed
RegisterName Registers the provided name into the current namescope
Seal Seals the current instance
UnregisterName Unregisters the provided name from the current namescope
UpdateName Updates previously registered item with new one. This is usefull to refresh Binginds when freezables are cloned

Properties

From HierarchicalDataTemplate


Name Description
None ItemContainerStyle Gets or sets the Style that is applied to the item container for each child item
None ItemTemplate Gets or sets the DataTemplate to apply to the ItemTemplate property on a generated HeaderedItemsControl (such as a MenuItem or a TreeViewItem), to indicate how to display items from the next level in the data hierarchy
None ItemTemplateSelector Gets or sets the DataTemplateSelector to apply to the ItemTemplateSelector property on a generated HeaderedItemsControl (such as a MenuItem or a TreeViewItem), to indicate how to select a template to display items from the next level in the data hierarchy
None ItemsSource Gets or sets the binding for this data template, which indicates where to find the collection that represents the next level in the data hierarchy
DP_ Dependency Property - RO_ Read only

From DataTemplate


Name Description
None DataType Gets or sets the type for which this DataTemplate is intended
RO Triggers Gets a collection of triggers that apply property values or perform actions based on one or more conditions.
DP_ Dependency Property - RO_ Read only

From FrameworkTemplate


Name Description
None Resources Gets or sets the collection of resources that can be used within the scope of this template.
None VisualTree Gets or sets the root node of the template.
DP_ Dependency Property - RO_ Read only

Events

HierarchicalDataTemplate has no events

© 2017 Noesis Technologies