Example #1
0
        void OnItemPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            Kontakt kontakt = sender as Kontakt;

            if (kontakt != null)
            {
                ModifiedKontakte.Add(kontakt);
            }
        }
Example #2
0
        void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                foreach (Kontakt newItem in e.NewItems)
                {
                    ModifiedKontakte.Add(newItem);


                    newItem.PropertyChanged += this.OnItemPropertyChanged;
                }
            }

            if (e.OldItems != null)
            {
                foreach (Kontakt oldItem in e.OldItems)
                {
                    ModifiedKontakte.Add(oldItem);

                    oldItem.PropertyChanged -= this.OnItemPropertyChanged;
                }
            }
        }