Closed Zebody closed 6 years ago
@Zebody Hi, it looks like you forgot to inherit the base MahApps style for the TreeViewItem
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource {x:Type TreeViewItem}}">
<Setter Property="IsExpanded" Value="{Binding Expanded}"/>
</Style>
</TreeView.ItemContainerStyle>
You're my god.. you save my life. I'm not good enough in Xaml... i didn't know the BaseOn.. I try and it works. Thx you very much for your Help. and thx for all your works.
Thanks for the help on posting this fix. Took a day to get to this thread :)
Thanks
Hello,
I'm Using Mahapps for a while. I'm starting a new project with only a treeview. I'm using a Hierarchical Datatemplace. No trouble to bind my observable collection and display it in the treeview.
The trouble is : My model have a property Expanded (bool) and i can't bind it in hierarchicalDatatemplate (logical it's for display data, not for setup / interact with the treeview) .
Example :
The only way i found on the web is using Style like this :
And yes it's work but i loose the Mahapps style and essentially the "fullrowselect" effect.
Do someone knows how i could bind this property to my object avoid loosing the fullrowselect effect ?
Thx in advance for your help and sorry very sorry for my poor english!