예제 #1
0
		// 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);
					}
				}
			}
		}
예제 #2
0
        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*/);
                    }
                }
            }
        }