System\Windows\Controls\ItemContainerGenerator.cs (12)
592static (state, o, d) => ItemsControl.EqualsEx(o, state), item,
931Debug.Assert(item == null || ItemsControl.EqualsEx(item, target),
1028if (!ItemsControl.EqualsEx(genItem, actualItem))
1205ItemsControl.ClearAlternationIndex(((RealizedItemBlock)block).ContainerAt(offset));
1848index = (block == _itemMap) ? -1 : ItemsControl.GetAlternationIndex(rib.ContainerAt(offset));
1870ItemsControl.SetAlternationIndex(rib.ContainerAt(offset), index);
1887index = (block == _itemMap) ? 1 : ItemsControl.GetAlternationIndex(rib.ContainerAt(offset));
1909ItemsControl.SetAlternationIndex(rib.ContainerAt(offset), index);
2212Debug.Assert(ItemsControl.EqualsEx(rib.ItemAt(rib.ContainerCount - 1),
2226ItemsControl.EqualsEx(rib.ItemAt(0),
2376Debug.Assert(ItemsControl.EqualsEx(item, ItemsInternal[index]), "Event contains the wrong index");
3057if (ItemsControl.EqualsEx(_entry[k].Item, item))
System\Windows\Controls\ItemsControl.cs (77)
55DefaultStyleKeyProperty.OverrideMetadata(typeof(ItemsControl), new FrameworkPropertyMetadata(typeof(ItemsControl)));
56_dType = DependencyObjectType.FromSystemTypeInternal(typeof(ItemsControl));
57EventManager.RegisterClassHandler(typeof(ItemsControl), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotFocus));
58VirtualizingStackPanel.ScrollUnitProperty.OverrideMetadata(typeof(ItemsControl), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnScrollingModeChanged), new CoerceValueCallback(CoerceScrollingMode)));
59VirtualizingPanel.CacheLengthProperty.OverrideMetadata(typeof(ItemsControl), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnCacheSizeChanged)));
60VirtualizingPanel.CacheLengthUnitProperty.OverrideMetadata(typeof(ItemsControl), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnCacheSizeChanged), new CoerceValueCallback(CoerceVirtualizationCacheLengthUnit)));
75if (((ItemsControl)d).IsGrouping && baseValueSource == BaseValueSource.Default)
97if ( !((ItemsControl)d).IsGrouping && !(d is TreeView) && baseValueSource == BaseValueSource.Default )
177= DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(ItemsControl),
183ItemsControl ic = (ItemsControl) d;
333typeof(ItemsControl),
363typeof(ItemsControl),
385ItemsControl ctrl = (ItemsControl) d;
450typeof(ItemsControl),
472((ItemsControl) d).OnItemTemplateChanged((DataTemplate) e.OldValue, (DataTemplate) e.NewValue);
501typeof(ItemsControl),
528((ItemsControl)d).OnItemTemplateSelectorChanged((DataTemplateSelector) e.OldValue, (DataTemplateSelector) e.NewValue);
556typeof(ItemsControl),
579ItemsControl ctrl = (ItemsControl)d;
605typeof(ItemsControl),
629ItemsControl ctrl = (ItemsControl)d;
677typeof(ItemsControl),
700((ItemsControl) d).OnItemContainerStyleChanged((Style) e.OldValue, (Style) e.NewValue);
729typeof(ItemsControl),
756((ItemsControl) d).OnItemContainerStyleSelectorChanged((StyleSelector) e.OldValue, (StyleSelector) e.NewValue);
781public static ItemsControl GetItemsOwner(DependencyObject element)
783ItemsControl container = null;
799container = panel.TemplatedParent as ItemsControl;
808ItemsControl temp;
819internal static DependencyObject GetItemsOwnerInternal(DependencyObject element, out ItemsControl itemsControl)
840itemsControl = container as ItemsControl;
854= DependencyProperty.Register("ItemsPanel", typeof(ItemsPanelTemplate), typeof(ItemsControl),
884((ItemsControl) d).OnItemsPanelChanged((ItemsPanelTemplate) e.OldValue, (ItemsPanelTemplate) e.NewValue);
899DependencyProperty.RegisterReadOnly("IsGrouping", typeof(bool), typeof(ItemsControl), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, new PropertyChangedCallback(OnIsGroupingChanged)));
921((ItemsControl)d).OnIsGroupingChanged(e);
973= DependencyProperty.Register("GroupStyleSelector", typeof(GroupStyleSelector), typeof(ItemsControl),
996((ItemsControl) d).OnGroupStyleSelectorChanged((GroupStyleSelector) e.OldValue, (GroupStyleSelector) e.NewValue);
1021typeof(ItemsControl),
1052ItemsControl ctrl = (ItemsControl) d;
1074typeof(ItemsControl),
1118typeof(ItemsControl),
1138typeof(ItemsControl),
1157public static ItemsControl ItemsControlFromItemContainer(DependencyObject container)
1164ItemsControl ic = LogicalTreeHelper.GetParent(ui) as ItemsControl;
1178return ItemsControl.GetItemsOwner(ui);
1187public static DependencyObject ContainerFromElement(ItemsControl itemsControl, DependencyObject element)
1225private static bool IsContainerForItemsControl(DependencyObject element, ItemsControl itemsControl)
1443ItemsControl ic = ItemsControlFromItemContainer(container);
1597ItemsControl ic;
1616else if ((ic = element as ItemsControl) != null)
1633ItemsControl ic;
1652else if ((ic = element as ItemsControl) != null)
1741internal void PrepareItemsControl(object item, ItemsControl parentItemsControl)
2152ItemsControl itemsControl = null;
2345ItemsControl itemsControl = GetEncapsulatingItemsControl(firstElement);
2411ItemsControl itemsControl = GetEncapsulatingItemsControl(firstElement);
2477ItemsControl itemsControl = GetEncapsulatingItemsControl(lastElement);
2505ItemsControl itemsControl = fe as ItemsControl;
3196ItemsControl itemsControl = (ItemsControl)sender;
3413private static ItemsControl GetEncapsulatingItemsControl(FrameworkElement element)
3417ItemsControl itemsControl = ItemsControl.ItemsControlFromItemContainer(element);
3429ItemsControl itemsControl = null;
3433private static object GetEncapsulatingItem(FrameworkElement element, out FrameworkElement container, out ItemsControl itemsControl)
3440itemsControl = ItemsControl.ItemsControlFromItemContainer(element);
3639else if (info.IsRemoved || !ItemsControl.EqualsEx(info.Item,
3682static (state, o, d) => ItemsControl.EqualsEx(o, state.item) && !state.claimedContainers.Contains(d),
3886if (!ItemsControl.EqualsEx(this.Item, that.Item))
System\Windows\Controls\TextSearch.cs (10)
36private TextSearch(ItemsControl itemsControl)
50internal static TextSearch EnsureInstance(ItemsControl itemsControl)
226_attachedTo.NavigateToItem(matchedItem, matchedItemIndex, new ItemsControl.ItemNavigateArgs(Keyboard.PrimaryDevice, ModifierKeys.None));
368private static int FindMatchingPrefix(ItemsControl itemsControl, string primaryTextPath, string prefix,
497internal static MatchedTextInfo FindMatchingPrefix(ItemsControl itemsControl, string prefix)
553private static string GetPrimaryTextPath(ItemsControl itemsControl)
628internal static string GetPrimaryTextFromItem(ItemsControl itemsControl, object item)
643private static BindingExpression CreateBindingExpression(ItemsControl itemsControl, object item, string primaryTextPath)
717return EnsureInstance(d as ItemsControl);
823private ItemsControl _attachedTo;
System\Windows\Controls\VirtualizingStackPanel.cs (70)
744ItemsControl itemsControl;
745ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
832ItemsControl itemsControl;
833ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
1194ElementViewportPosition elementPosition = ItemsControl.GetElementViewportPosition(
1235ItemsControl itemsControl = fe as ItemsControl;
1255ItemsControl itemsControl;
1258if ((itemsControl = fe as ItemsControl) != null)
1618ItemsControl itemsControl = ItemsControl.GetItemsOwner(this);
1685private void BringContainerIntoView(ItemsControl itemsControl, int itemIndex)
1995ItemsControl itemsControl = ItemsControl.GetItemsOwner(this);
2146ItemsControl itemsControl = null;
3302ItemsControl itemsControl = null;
3743DependencyObject itemsOwner = ItemsControl.GetItemsOwnerInternal(this);
3783ItemsControl itemsControl;
4020ItemsControl itemsControl;
4021ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
4084ItemsControl itemsControl = null;
4085DependencyObject itemsOwner = ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
4137ItemsControl itemsControl = null;
4140DependencyObject itemsOwner = ItemsControl.GetItemsOwnerInternal(itemsHost, out itemsControl);
4155out ItemsControl itemsControl,
4171ItemsControl parentItemsControl = null;
4172DependencyObject itemsOwner = ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
4180parentItemsControl = ItemsControl.GetItemsOwnerInternal(VisualTreeHelper.GetParent(itemsControl)) as ItemsControl;
4198ItemsControl.GetItemsOwnerInternal(VisualTreeHelper.GetParent(itemsOwner)) as IContainItemStorage;
4231ItemsControl itemsControl,
6520ItemsControl scrollingItemsControl = GetScrollingItemsControl(child);
6555private ItemsControl GetScrollingItemsControl(UIElement container)
6559ItemsControl parent = ItemsControl.ItemsControlFromItemContainer(container);
6568parent = ItemsControl.ItemsControlFromItemContainer(parent);
6577ItemsControl parentItemsControl = parent as ItemsControl;
9027ItemsControl itemsControl)
9043ItemsControl itemsControl,
9215ItemsControl itemsControl = ItemsControl.GetItemsOwner(this);
9395ItemsControl itemsControl = null;
9396ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
9441private bool NotifyCleanupItem(int childIndex, UIElementCollection children, ItemsControl itemsControl)
9446private bool NotifyCleanupItem(UIElement child, ItemsControl itemsControl)
11003ItemsControl itemsControl;
11033ItemsControl scrollingItemsControl = ItemsControl.GetItemsOwner(this);
11110ItemsControl.GetItemsOwnerInternal(VisualTreeHelper.GetParent((Visual)itemStorageProvider)) as IContainItemStorage;
12075ItemsControl target = o as ItemsControl;
12144ItemsControl itemsControl)
12311private WeakReference<ItemsControl> _wrIC;
12318private ScrollTracer(ItemsControl itemsControl, VirtualizingStackPanel vsp, TraceList traceList)
12320_wrIC = new WeakReference<ItemsControl>(itemsControl);
12353private void IdentifyTrace(ItemsControl ic, VirtualizingStackPanel vsp)
12404if (_wrIC.TryGetTarget(out ItemsControl ic))
12420if (_wrIC.TryGetTarget(out ItemsControl ic))
12498private static List<Tuple<WeakReference<ItemsControl>,TraceList>> s_TargetToTraceListMap
12499= new List<Tuple<WeakReference<ItemsControl>,TraceList>>();
12502static TraceList TraceListForItemsControl(ItemsControl target)
12511WeakReference<ItemsControl> wr = s_TargetToTraceListMap[i].Item1;
12512ItemsControl itemsControl;
12530private static TraceList AddToMap(ItemsControl target)
12557new Tuple<WeakReference<ItemsControl>,TraceList>(
12558new WeakReference<ItemsControl>(target),
12582WeakReference<ItemsControl> wr = s_TargetToTraceListMap[i].Item1;
12583ItemsControl unused;
13060DependencyObject parentContainer = ItemsControl.ContainerFromElement(null, vsp);
System\Windows\Data\ListCollectionView.cs (17)
759if (!System.Windows.Controls.ItemsControl.EqualsEx(newItem, SourceList[index]))
769Debug.Assert(_newItemIndex != -2 && System.Windows.Controls.ItemsControl.EqualsEx(newItem, _newItem), "AddNew did not raise expected events");
1029if (!System.Windows.Controls.ItemsControl.EqualsEx(item, _newItem))
1094if (index >= InternalCount || !System.Windows.Controls.ItemsControl.EqualsEx(item, GetItemAt(index)))
1166if (System.Windows.Controls.ItemsControl.EqualsEx(item, _newItem))
1361if (!System.Windows.Controls.ItemsControl.EqualsEx(item, _editItem))
1913(IsAddingNew && System.Windows.Controls.ItemsControl.EqualsEx(_newItem, newItem)));
1951System.Windows.Controls.ItemsControl.EqualsEx(ItemFrom(InternalList[localOldIndex]), oldItem))
2004bool simpleMove = System.Windows.Controls.ItemsControl.EqualsEx(oldItem, newItem);
2013System.Windows.Controls.ItemsControl.EqualsEx(InternalList[localOldIndex], oldItem))
2185else if (IsAddingNew && System.Windows.Controls.ItemsControl.EqualsEx(item, _newItem))
2667System.Windows.Controls.ItemsControl.EqualsEx(item, _newItem))
2694if (!System.Windows.Controls.ItemsControl.EqualsEx(item, ilFull[index]))
2793if (System.Windows.Controls.ItemsControl.EqualsEx(ilFull[fullIndex], ilPartial[localIndex]))
2799else if (System.Windows.Controls.ItemsControl.EqualsEx(item, ilPartial[localIndex]))
2986if (!IsAddingNew || !System.Windows.Controls.ItemsControl.EqualsEx(_newItem, item))
3198if (System.Windows.Controls.ItemsControl.EqualsEx(item, ilFull[index]))