예제 #1
0
 public SelectorSortDescriptionsAdapter(IValueAdapter collectionViewAdapter)
 {
     if (collectionViewAdapter == null)
     {
         throw new ArgumentNullException("collectionViewAdapter");
     }
     _collectionChangedCallback = _ => { };
     _collectionViewAdapter     = collectionViewAdapter;
     _collectionViewAdapter.ValueChangedCallback = OnCollectionViewChanged;
     RefreshCollectionView();
 }
예제 #2
0
 public DataGridSelectedItemsAdapter(DataGrid control, Func <object, object> itemKeySelector)
 {
     if (control == null)
     {
         throw new ArgumentNullException("control");
     }
     if (itemKeySelector == null)
     {
         throw new ArgumentNullException("itemKeySelector");
     }
     _collectionChangedCallback = instructions => { };
     _control              = control;
     _selectorAdapter      = new ValueToCollectionAdapter(new SelectorSelectedItemsAdapter(control, itemKeySelector));
     _multiSelectorAdapter = new MultiSelectorSelectedItemsAdapter(control, itemKeySelector);
     _selectorAdapter.CollectionChangedCallback      = OnSelectorCollectionChanged;
     _multiSelectorAdapter.CollectionChangedCallback = OnMultiSelectorCollectionChanged;
 }