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; }
// Token: 0x0600592F RID: 22831 RVA: 0x0018A4C1 File Offset: 0x001886C1 internal void PrepareItemContainer(object item, ItemsControl parentItemsControl) { Helper.ClearVirtualizingElement(this); TreeViewItem.IsVirtualizingPropagationHelper(parentItemsControl, this); if (VirtualizingPanel.GetIsVirtualizing(parentItemsControl)) { Helper.SetItemValuesOnContainer(parentItemsControl, this, item); } }
// 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; }
internal void PrepareItemContainer(object item, ItemsControl parentItemsControl) { // // Clear previously cached items sizes // Helper.ClearVirtualizingElement((IHierarchicalVirtualizationAndScrollInfo)this); IsVirtualizingPropagationHelper(parentItemsControl, this); // // ItemValueStorage: restore saved values for this item onto the new container // if (VirtualizingPanel.GetIsVirtualizing(parentItemsControl)) { Helper.SetItemValuesOnContainer(parentItemsControl, this, item); } }
// Token: 0x06004E08 RID: 19976 RVA: 0x0015FBB4 File Offset: 0x0015DDB4 private static void OnExpanded(object sender, RoutedEventArgs e) { GroupItem groupItem = sender as GroupItem; if (groupItem != null && groupItem._expander != null && groupItem._expander.IsExpanded) { ItemsControl parentItemsControl = groupItem.ParentItemsControl; if (parentItemsControl != null && VirtualizingPanel.GetIsVirtualizing(parentItemsControl) && VirtualizingPanel.GetVirtualizationMode(parentItemsControl) == VirtualizationMode.Recycling) { ItemsPresenter itemsHostPresenter = groupItem.ItemsHostPresenter; if (itemsHostPresenter != null) { groupItem.InvalidateMeasure(); Helper.InvalidateMeasureOnPath(itemsHostPresenter, groupItem, false); } } } }
private static void OnExpanded(object sender, RoutedEventArgs e) { GroupItem groupItem = sender as GroupItem; if (groupItem != null && groupItem._expander != null && groupItem._expander.IsExpanded) { ItemsControl itemsControl = groupItem.ParentItemsControl; if (itemsControl != null && VirtualizingPanel.GetIsVirtualizing(itemsControl) && VirtualizingPanel.GetVirtualizationMode(itemsControl) == VirtualizationMode.Recycling) { ItemsPresenter itemsHostPresenter = groupItem.ItemsHostPresenter; if (itemsHostPresenter != null) { // In case a GroupItem that wasn't previously expanded is now // recycled to represent an entity that is expanded, we face a situation // where the ItemsHost isn't connected yet but we do need to synchronously // remeasure the sub tree through the ItemsPresenter leading up to the // ItemsHost panel. If we didnt do this the offsets could get skewed. groupItem.InvalidateMeasure(); Helper.InvalidateMeasureOnPath(itemsHostPresenter, groupItem, false /*duringMeasure*/); } } } }
// Token: 0x06005A23 RID: 23075 RVA: 0x0018D664 File Offset: 0x0018B864 private static object CoerceIsVirtualizingWhenGrouping(DependencyObject d, object baseValue) { bool isVirtualizing = VirtualizingPanel.GetIsVirtualizing(d); return(isVirtualizing && (bool)baseValue); }