benruehl / adonis-ui

Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
https://benruehl.github.io/adonis-ui/
MIT License
1.69k stars 143 forks source link

Not sure if I did something wrong but only the root TreeViewItem has a style #163

Closed mrmelon54 closed 3 years ago

mrmelon54 commented 3 years ago

Here is an example of my styling issue: image Here is my xaml source for the tree view

<TreeView x:Name="NbtTreeElement" SelectedItemChanged="NbtTreeElement_SelectedItemChanged" >
    <TreeView.Resources>
        <Style TargetType="TreeView" BasedOn="{StaticResource {x:Type TreeView}}" />
    </TreeView.Resources>
</TreeView>

I am adding the items dynamically in the code using a class which extends TreeViewItem and edits the Header and other properties in the constructor.

mrmelon54 commented 3 years ago

Well I figured something out and it works even if it is a little hacky lol

tizu69 commented 2 years ago

Well I figured something out and it works even if it is a little hacky lol

What is your solution? I'm having the same problem and found no solution (I also searched online without success).

mrmelon54 commented 2 years ago

I recon it was probably this line:

ItemContainerStyle = (Style)Parent.GetValue(ItemContainerStyleProperty);

but I haven't worked on that project in so long so I have no idea if that was actually the fix?