コード例 #1
0
        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();
        }
コード例 #2
0
 private static void SetSelectionBinder(DependencyObject obj, ListViewSelectionBinder items)
 => obj.SetValue(SelectionBinderProperty, items);