Exemplo n.º 1
0
        void Annotations_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                foreach (var item in e.NewItems)
                {
                    var viewModel = new AnnotationViewModel(this, item as AnnotationModel);
                    _annotations.Add(viewModel);
                }
                break;

            case NotifyCollectionChangedAction.Reset:
                _annotations.Clear();
                break;

            case NotifyCollectionChangedAction.Remove:
                foreach (var item in e.OldItems)
                {
                    _annotations.Remove(_annotations.First(x => x.AnnotationModel == item));
                }
                break;
            }
        }
Exemplo n.º 2
0
 void Annotations_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     switch (e.Action)
     {
         case NotifyCollectionChangedAction.Add:
             foreach (var item in e.NewItems)
             {                     
                 var viewModel = new AnnotationViewModel(this, item as AnnotationModel);
                 _annotations.Add(viewModel);
             }
             break;
         case NotifyCollectionChangedAction.Reset:
             _annotations.Clear();
             break;
         case NotifyCollectionChangedAction.Remove:
             foreach (var item in e.OldItems)
             {
                 _annotations.Remove(_annotations.First(x => x.AnnotationModel == item));
             }
             break;
     }
 }
Exemplo n.º 3
0
        private void Model_AnnotationAdded(AnnotationModel annotation)
        {
            var viewModel = new AnnotationViewModel(this, annotation);

            _annotations.Add(viewModel);
        }
Exemplo n.º 4
0
 private void Model_AnnotationAdded(AnnotationModel annotation)
 {
     var viewModel = new AnnotationViewModel(this, annotation);
     _annotations.Add(viewModel);
 }