There is a TreeView with several TreeViewItem .

How can I bind Selected / Unselected events to methods declared in another window?

  • Show some code for this - Artyom

2 answers 2

TreeViewItem.Selected + = method;

    There must be a Dispatcher.BeginInvoke on the TreeViewItem object. With it, it must be in the main thread of the handler that can be called.

    See the example at https://msdn.microsoft.com/en-us/library/ms741870.aspx