Mouse Over Trigger for TreeViewItem

The problem with the IsMouseOver property on TreeViewItem in WPF is that when it is set to true for a child node it is also true for parent nodes. Therefore if you try to add a trigger with IsMouseOver property you will observe the following behavior: Code Snippet <TreeView x:Name=”TreeViewControl” ItemsSource=”{Binding}”>     <TreeView.Resources>         <HierarchicalDataTemplate…

3

Setting TreeView SelectedItem in Code

It is possible to set the selected item of a TreeView control in WPF without direct interaction with UI elements by including IsSelected property in your data object and binding it to IsSelected property of TreeViewItem. The code snippets below indicate how to set expanded and selected items of a TreeView control by updating the…

7

Office-like WPF Tooltip for Hyperlinks

You can have Office-like tooltips for the hyperlinks displayed in RichTextBox control in WPF. First thing to note is enabling the hyperlinks in RichTextBox by setting IsDocumentEnabled property. Then, we will bind the ToolTip property of the hyperlink to its NavigateUri property to be able to use it in the new DataTemplate of the ToolTip….

1