✅ WPF TreeView only shows icon and only for the root item

have a tree declared with the following XAML and added from code behind a single item for the root. The root item does have children and a name for each item. But nothing appears beyond a single icon. XAML is reporting no binding failures. I've put breakpoints in for the Children, LocalizedName, and LocalizedLongDesc properties, but of those, only Children is called. What's going on?
<TreeView
x:Name="treeLogicalSelector">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate
DataType="TreeData:VisualTreeData"
ItemsSource="{Binding Children}">
<StackPanel
Orientation="Horizontal"
ToolTip="{Binding LocalizedLongDesc}">
<Emoji:TextBlock
Text="{Binding Icon}"
VerticalAlignment="Center" />
<Label
Content="{Binding LocalizedName}"
VerticalAlignment="Center" />
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
<TreeView
x:Name="treeLogicalSelector">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate
DataType="TreeData:VisualTreeData"
ItemsSource="{Binding Children}">
<StackPanel
Orientation="Horizontal"
ToolTip="{Binding LocalizedLongDesc}">
<Emoji:TextBlock
Text="{Binding Icon}"
VerticalAlignment="Center" />
<Label
Content="{Binding LocalizedName}"
VerticalAlignment="Center" />
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
1 Reply
Will Pittenger
Will PittengerOP14mo ago
Oops. I realized I derived from DependencyObject and had my class declare some DependencyProperty instances, but then coded like I was doing something else.
Want results from more Discord servers?
Add your server