Microsoft.Samples.KMoore.WPFSamples.Zap.ZapScroller.parentItemsChanged C# (CSharp) Method

parentItemsChanged() private method

private parentItemsChanged ( ) : void
return void
        private void parentItemsChanged()
        {
            ItemCollection newParentItems = (ItemCollection)GetValue(ParentItemsInternalProperty);

            if (newParentItems != ParentItems)
            {
                if (ParentItems != null)
                {
                    INotifyCollectionChanged incc = ParentItems as INotifyCollectionChanged;
                    incc.CollectionChanged -= parentItemsContentChanged;
                }
                if (newParentItems != null)
                {
                    INotifyCollectionChanged incc = newParentItems as INotifyCollectionChanged;
                    incc.CollectionChanged += parentItemsContentChanged;
                }

                ParentItems = newParentItems;

                resetParentItems();
            }
        }

Same methods

ZapScroller::parentItemsChanged ( DependencyObject element, DependencyPropertyChangedEventArgs e ) : void