sourcenouveau
sourcenouveau

Reputation: 30554

Preventing WPF TreeView's SelectedItemChanged event from bubbling

I have a WPF TreeView which triggers a SelectedItemChanged event. Whenever I select an item in the TreeView, the SelectedItemChanged event is triggered for the selected item and all of the selected node's ancestors in the tree.

How do I prevent the SelectedItemChanged event from firing more than once?

Upvotes: 3

Views: 3066

Answers (1)

Kenan E. K.
Kenan E. K.

Reputation: 14111

Set the e.Handled to true in the handler.

EDIT

As an update to this subject, view this blog post.

Upvotes: 2

Related Questions