Question

How can I change the triangle shape next to the expandable TreeViewItem in the XAML below?

<Grid>
    <TreeView>
        <TreeViewItem  Header="Columns" IsExpanded="True">
            <TreeViewItem Header="Model" IsSelected="True"/>
            <TreeViewItem Header="Layout"/>
            <TreeViewItem Header="Elevations"/>
        </TreeViewItem>
        <TreeViewItem Header="Beams/Floors" IsExpanded="True">
            <TreeViewItem Header="Model"/>
            <TreeViewItem Header="Layout"/>
            <TreeViewItem Header="Elevations"/>
        </TreeViewItem>
        <TreeViewItem Header="Foundation" IsExpanded="True">
            <TreeViewItem Header="Model"/>
            <TreeViewItem Header="Layout"/>
        </TreeViewItem>
        <TreeViewItem Header="Walls" IsExpanded="True">
            <TreeViewItem Header="Model"/>
            <TreeViewItem Header="Layout"/>
            <TreeViewItem Header="Elevations"/>
        </TreeViewItem>
    </TreeView>
</Grid>

enter image description here

Était-ce utile?

La solution

Here is the template of the TreeView. You can see in the template the style ExpandCollapseToggleStyle in which there are two Path named Collapsed and Expanded. You can change them as you wish.

Autres conseils

you can use the mentioned link Change Icon

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top