Microsoft.Practices.Prism.Regions.Behaviors.BindRegionContextToDependencyObjectBehavior.Views_CollectionChanged C# (CSharp) Method

Views_CollectionChanged() private method

private Views_CollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void
sender object
e NotifyCollectionChangedEventArgs
return void
        private void Views_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.Add)
            {
                SetContextToViews(e.NewItems, this.Region.Context);
                this.AttachNotifyChangeEvent(e.NewItems);
            }
            else if (e.Action == NotifyCollectionChangedAction.Remove && this.Region.Context != null)
            {
                this.DetachNotifyChangeEvent(e.OldItems);
                SetContextToViews(e.OldItems, null);
                
            }
        }