NoesisGUI

HierarchicalDataTemplate Class

namespace Noesis | MSDN

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>

Inheritance Hierarchy

HierarchicalDataTemplate

INDEX Class Hierarchy Index

Properties


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

Methods

From FrameworkTemplate

Name Description
Apply Applies current template to the specified element
FindName Finds the element associated with the specified name defined within this template
FindName Returns an object that has the provided identifying name
FindObject Finds if element is a named object registered in the template. Returns null if not found
GetAvailableTriggers Gets template triggers if available
RegisterName Registers the provided name into the current XAML namescope
UnregisterName Unregisters the provided name from the current XAML namescope
UpdateName Updates previously registered item with new one. This is required to refresh Binginds when freezables are cloned during animations

Events

HierarchicalDataTemplate has no events

© 2017 Noesis Technologies