WPF TreeView Style
-
Ok, I finally got my treeview with hyperlinks working. Thanks SledgeHammer! I now have the following
<Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="TextBlock.TextDecorations" Value="Underline"/> <Setter Property="Foreground" Value="RoyalBlue" /> </Trigger> <Trigger Property="IsMouseOver" Value="False"> <Setter Property="TextBlock.TextDecorations" Value="{x:Null}"/> <Setter Property="Foreground" Value="RoyalBlue" /> </Trigger> </Style.Triggers> <Setter </x-turndown>
-
Ok, I finally got my treeview with hyperlinks working. Thanks SledgeHammer! I now have the following
<Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="TextBlock.TextDecorations" Value="Underline"/> <Setter Property="Foreground" Value="RoyalBlue" /> </Trigger> <Trigger Property="IsMouseOver" Value="False"> <Setter Property="TextBlock.TextDecorations" Value="{x:Null}"/> <Setter Property="Foreground" Value="RoyalBlue" /> </Trigger> </Style.Triggers> <Setter </x-turndown>
you can do this using the following steps.
.
.
.
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />.
.
.and in the treeview
and in the datatemplate add a key
I would like note one thing about managing resources. All the related resources should be added in the resource dictionary. In your case I would like to suggest that, have separate resource dictionary e.g. "NavigationTreeResources.xaml" for TreeView and add your DataTemplates and style in it. Adding the resources in Windows makes the windows.xaml huge as well as restrict the scope of the resources to current :) window. Hope this information helps to solve your problem
Happy Coding :-D:-D