Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I am creating Treeview in wpf.

Each parent item set random foreground color using converter.
I want all its children to set the same color. using only xaml.

Here is part of my code:

XML
<HierarchicalDataTemplate DataType="{x:Type sotc:Category}" ItemsSource="{Binding Path=NoteList}">
   <TextBlock Text="{Binding Path=Name}" Forground="{Binding Path=Name, Convert={StaticResource Converter1}}"/>
   </HierarchicalDataTemplate>

XML
<HierarchicalDataTemplate DataType="{x:Type sotc:Note}">
   <TextBlock Text="{Binding Path=Name}" />
   </HierarchicalDataTemplate>


What I wish to do is to set the second treeview item. Children in HierarchicalData the same forgound color has the parent.
Is there a way to do that?

Thank Ahead,
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900