Skip to content

TreeDataGrid's Expand/Collapse button #17970

Answered by msneijders
nasterhe asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know why you cannot override Theme like this.

I think this has to do with BindingPriority and Setter precedence. Where a simple Style selector gets priority "Style", and the Theme assignment inside the template has "Template", which has higher precedence.

But you can "lift up" the BindingPriority to "StyleTrigger" if you add a class name; and then it gets precedence over Template:

<Style Selector="TreeDataGrid.test TreeDataGridExpanderCell /template/ ToggleButton">
    <Setter Property="Theme" Value="{StaticResource MyTreeDataGridExpandCollapseChevron}" />
</Style>

<TreeDataGrid Classes="test" />

Just learned something new ;). But if you want your styling in all of your treedat…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@nasterhe
Comment options

@msneijders
Comment options

@msneijders
Comment options

Answer selected by nasterhe
@nasterhe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants