Create Event Handler for TreeViewItem in WPF

后端 未结 4 1959
被撕碎了的回忆
被撕碎了的回忆 2021-01-06 05:22

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 selecti

4条回答
  •  [愿得一人]
    2021-01-06 05:23

    Selection and Selection and focus are two different concepts. It sounds like you're interested in selection, which in this case is a property of the TreeView. Event TreeView.SelectedItemChanged will notify you of selection changes and property TreeView.SelectedItem will tell you what is selected.

提交回复
热议问题