Exemplo n.º 1
0
 protected virtual void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     switch (e.Action)
     {
         case NotifyCollectionChangedAction.Add:
             AddItems(e.NewItems);
             break;
         case NotifyCollectionChangedAction.Remove:
             RemoveItems(e.OldItems);
             break;
         case NotifyCollectionChangedAction.Move:
         case NotifyCollectionChangedAction.Replace:
             RemoveItems(e.OldItems);
             AddItems(e.NewItems);
             break;
         default:
             ResetCollection();
             break;
     }
 }
Exemplo n.º 2
0
 protected override void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     base.CollectionChanged(sender, e);
     Reselect();
 }