protected virtual void OnSelectedItemChanged(EventArgs e) { if (oldSelectedItem != null) { oldSelectedItem.PropertyChanged -= SelectedItemPropertyChanged; } oldSelectedItem = SelectedItem; if (oldSelectedItem != null) { oldSelectedItem.PropertyChanged += SelectedItemPropertyChanged; } }
protected virtual void OnSelectedItemChanged(EventArgs e) { if (oldSelectedItem != null) oldSelectedItem.PropertyChanged -= SelectedItemPropertyChanged; oldSelectedItem = SelectedItem; if (oldSelectedItem != null) oldSelectedItem.PropertyChanged += SelectedItemPropertyChanged; }