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

📚 Class Hierarchy Index

Properties

Name Description
◆ ItemContainerStyle Gets or sets the Style that is applied to the item container for each child item
◆ 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
◆ 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
◆ 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

◆ Dependency Property   ◆ Reflection Property


From DataTemplate

Name Description
◆ DataType Gets or sets the type for which this DataTemplate is intended
◆ Triggers Gets a collection of triggers that apply property values or perform actions based on one or more conditions.

◆ Dependency Property   ◆ Reflection Property

From FrameworkTemplate

Name Description
◆ Resources Gets or sets the collection of resources that can be used within the scope of this template
◆ VisualTree Gets or sets the root node of the template

◆ Dependency Property   ◆ Reflection Property

Attached Properties

HierarchicalDataTemplate has no attached properties

Methods

From FrameworkTemplate

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