private static void OnSelectedItemsChanged(DependencyObject o, DependencyPropertyChangedEventArgs value) { GetSelectionBinder(o)?.Unsubscribe(); var newSelectionBinder = new ListViewSelectionBinder((ListBox)o, (IList?)value.NewValue ?? new List <object>()); SetSelectionBinder(o, newSelectionBinder); newSelectionBinder.Subscribe(); }
private static void SetSelectionBinder(DependencyObject obj, ListViewSelectionBinder items) => obj.SetValue(SelectionBinderProperty, items);