Create Event Handler for TreeViewItem in WPF

Posted by nihi_l_ist on Stack Overflow See other posts from Stack Overflow or by nihi_l_ist
Published on 2010-04-10T16:07:26Z Indexed on 2010/04/10 16:13 UTC
Read the original article Hit count: 518

Filed under:
|
|

Im adding items to TreeView control via ItemsSource property and ItemTemplate property to set the template for TreeViewItem. How can i add an event handler to handle selection change event on TreeViewItems?
For now my ItemTemplate looks like this:

<Window.Resources><DataTemplate x:Key="PeerDetailTemplate">
        <TextBlock Text="{Binding DESCRIPTION}" Tag="{Binding ID}" GotFocus="GetModules"/>
</DataTemplate></Window.Resources>

But it doesnt work (GetModules is not called). Im new to WPF, so show me the right direction to do such things, please.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about treeview