TreeView.OnSelectedItemChanged(RoutedPropertyChangedEventArgs<Object>) Method


Raises the SelectedItemChanged event when the SelectedItem property value changes.

 virtual void OnSelectedItemChanged(System::Windows::RoutedPropertyChangedEventArgs<System::Object ^> ^ e);
protected virtual void OnSelectedItemChanged (System.Windows.RoutedPropertyChangedEventArgs<object> e);
abstract member OnSelectedItemChanged : System.Windows.RoutedPropertyChangedEventArgs<obj> -> unit
override this.OnSelectedItemChanged : System.Windows.RoutedPropertyChangedEventArgs<obj> -> unit
Protected Overridable Sub OnSelectedItemChanged (e As RoutedPropertyChangedEventArgs(Of Object))



Provides the item that was previously selected and the item that is currently selected for the SelectedItemChanged event.


The event data that the parameter e provides contains an DependencyPropertyChangedEventArgs.OldValue and a PropertyDataChangedEventArgs.NewValue. The DependencyPropertyChangedEventArgs.OldValue is set to the item that was previously selected, or is set to null if there is no previously selected item. Similarly, the PropertyDataChangedEventArgs.NewValue is set to the newly selected item, or is set to null if no new item is selected.

Applies to