Пример #1
0
        internal void ClearItemContainer(object item, ItemsControl parentItemsControl)
        {
            if (VirtualizingPanel.GetIsVirtualizing(parentItemsControl))
            {
                //
                // ItemValueStorage:  save off values for this container if we're a virtualizing TreeView.
                //

                //
                // Right now we have a hard-coded list of DPs we want to save off.  In the future we could provide a 'register' API
                // so that each ItemsControl could decide what DPs to save on its containers. Maybe we define a virtual method to
                // retrieve a list of DPs the type is interested in.  Alternatively we could have the contract
                // be that ItemsControls use the ItemStorageService inside their ClearContainerForItemOverride by calling into StoreItemValues.
                //
                Helper.StoreItemValues(parentItemsControl, this, item);

                // Tell the panel to clear off all its containers.  This will cause this method to be called
                // recursively down the tree, allowing all descendent data to be stored before we save off
                // the ItemValueStorage DP for this container.

                VirtualizingPanel vp = ItemsHost as VirtualizingPanel;
                if (vp != null)
                {
                    vp.OnClearChildrenInternal();
                }

                ItemContainerGenerator.RemoveAllInternal(true /*saveRecycleQueue*/);
            }

            // this container is going away - forget about its selection
            ContainsSelection = false;
        }
Пример #2
0
		// Token: 0x06004E0F RID: 19983 RVA: 0x0015FE30 File Offset: 0x0015E030
		internal void ClearItemContainer(object item, ItemsControl parentItemsControl)
		{
			if (this.Generator == null)
			{
				return;
			}
			if (parentItemsControl != null && VirtualizingPanel.GetIsVirtualizingWhenGrouping(parentItemsControl))
			{
				Helper.StoreItemValues(parentItemsControl, this, item);
				if (this._expander != null)
				{
					Helper.StoreItemValues(parentItemsControl, this._expander, item);
				}
				VirtualizingPanel virtualizingPanel = this._itemsHost as VirtualizingPanel;
				if (virtualizingPanel != null)
				{
					virtualizingPanel.OnClearChildrenInternal();
				}
				this.Generator.RemoveAllInternal(true);
			}
			else
			{
				this.Generator.Release();
			}
			base.ClearContentControl(item);
		}
Пример #3
0
        internal void ClearItemContainer(object item, ItemsControl parentItemsControl)
        {
            if (Generator == null)
            {
                return;     // user-declared GroupItem - ignore (bug 108423)
            }
            ItemContainerGenerator generator  = Generator.Parent;
            GroupStyle             groupStyle = generator.GroupStyle;

            if (Object.Equals(this.Content, item))
            {
                ClearValue(ContentProperty);
            }
            if (this.ContentTemplate == groupStyle.HeaderTemplate)
            {
                ClearValue(ContentTemplateProperty);
            }
            if (this.ContentTemplateSelector == groupStyle.HeaderTemplateSelector)
            {
                ClearValue(ContentTemplateSelectorProperty);
            }
            if (this.ContentStringFormat == groupStyle.HeaderStringFormat)
            {
                ClearValue(ContentStringFormatProperty);
            }

            //
            // ItemValueStorage:  save off values for this container if we're a virtualizing Group.
            //
            if (parentItemsControl != null && VirtualizingPanel.GetIsVirtualizingWhenGrouping(parentItemsControl))
            {
                Helper.StoreItemValues((IContainItemStorage)parentItemsControl, this, item);

                if (_expander != null)
                {
                    Helper.StoreItemValues((IContainItemStorage)parentItemsControl, _expander, item);
                }

                // Tell the panel to clear off all its containers.  This will cause this method to be called
                // recursively down the tree, allowing all descendent data to be stored before we save off
                // the ItemValueStorage DP for this container.

                VirtualizingPanel vp = _itemsHost as VirtualizingPanel;
                if (vp != null)
                {
                    vp.OnClearChildrenInternal();
                }

                Generator.RemoveAllInternal(true /*saveRecycleQueue*/);
            }
            else
            {
                Generator.Release();
            }
        }
 // Token: 0x06005930 RID: 22832 RVA: 0x0018A4E0 File Offset: 0x001886E0
 internal void ClearItemContainer(object item, ItemsControl parentItemsControl)
 {
     if (VirtualizingPanel.GetIsVirtualizing(parentItemsControl))
     {
         Helper.StoreItemValues(parentItemsControl, this, item);
         VirtualizingPanel virtualizingPanel = base.ItemsHost as VirtualizingPanel;
         if (virtualizingPanel != null)
         {
             virtualizingPanel.OnClearChildrenInternal();
         }
         base.ItemContainerGenerator.RemoveAllInternal(true);
     }
     this.ContainsSelection = false;
 }
Пример #5
0
        internal void ClearItemContainer(object item, ItemsControl parentItemsControl)
        {
            if (Generator == null)
            {
                return;     // user-declared GroupItem - ignore (
            }
            //
            // ItemValueStorage:  save off values for this container if we're a virtualizing Group.
            //
            if (parentItemsControl != null && VirtualizingPanel.GetIsVirtualizingWhenGrouping(parentItemsControl))
            {
                Helper.StoreItemValues((IContainItemStorage)parentItemsControl, this, item);

                if (_expander != null)
                {
                    Helper.StoreItemValues((IContainItemStorage)parentItemsControl, _expander, item);
                }

                // Tell the panel to clear off all its containers.  This will cause this method to be called
                // recursively down the tree, allowing all descendent data to be stored before we save off
                // the ItemValueStorage DP for this container.

                VirtualizingPanel vp = _itemsHost as VirtualizingPanel;
                if (vp != null)
                {
                    vp.OnClearChildrenInternal();
                }

                Generator.RemoveAllInternal(true /*saveRecycleQueue*/);
            }
            else
            {
                Generator.Release();
            }

            ClearContentControl(item);
        }