System\Windows\Controls\ItemContainerGenerator.cs (12)
591static (state, o, d) => ItemsControl.EqualsEx(o, state), item,
930Debug.Assert(item == null || ItemsControl.EqualsEx(item, target),
1027if (!ItemsControl.EqualsEx(genItem, actualItem))
1201ItemsControl.ClearAlternationIndex(((RealizedItemBlock)block).ContainerAt(offset));
1844index = (block == _itemMap) ? -1 : ItemsControl.GetAlternationIndex(rib.ContainerAt(offset));
1866ItemsControl.SetAlternationIndex(rib.ContainerAt(offset), index);
1883index = (block == _itemMap) ? 1 : ItemsControl.GetAlternationIndex(rib.ContainerAt(offset));
1905ItemsControl.SetAlternationIndex(rib.ContainerAt(offset), index);
2205Debug.Assert(ItemsControl.EqualsEx(rib.ItemAt(rib.ContainerCount - 1),
2219ItemsControl.EqualsEx(rib.ItemAt(0),
2369Debug.Assert(ItemsControl.EqualsEx(item, ItemsInternal[index]), "Event contains the wrong index");
3050if (ItemsControl.EqualsEx(_entry[k].Item, item))
System\Windows\Controls\ItemsControl.cs (77)
54DefaultStyleKeyProperty.OverrideMetadata(typeof(ItemsControl), new FrameworkPropertyMetadata(typeof(ItemsControl)));
55_dType = DependencyObjectType.FromSystemTypeInternal(typeof(ItemsControl));
56EventManager.RegisterClassHandler(typeof(ItemsControl), Keyboard.GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotFocus));
57VirtualizingStackPanel.ScrollUnitProperty.OverrideMetadata(typeof(ItemsControl), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnScrollingModeChanged), new CoerceValueCallback(CoerceScrollingMode)));
58VirtualizingPanel.CacheLengthProperty.OverrideMetadata(typeof(ItemsControl), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnCacheSizeChanged)));
59VirtualizingPanel.CacheLengthUnitProperty.OverrideMetadata(typeof(ItemsControl), new FrameworkPropertyMetadata(new PropertyChangedCallback(OnCacheSizeChanged), new CoerceValueCallback(CoerceVirtualizationCacheLengthUnit)));
74if (((ItemsControl)d).IsGrouping && baseValueSource == BaseValueSource.Default)
96if ( !((ItemsControl)d).IsGrouping && !(d is TreeView) && baseValueSource == BaseValueSource.Default )
176= DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(ItemsControl),
182ItemsControl ic = (ItemsControl) d;
332typeof(ItemsControl),
362typeof(ItemsControl),
384ItemsControl ctrl = (ItemsControl) d;
449typeof(ItemsControl),
471((ItemsControl) d).OnItemTemplateChanged((DataTemplate) e.OldValue, (DataTemplate) e.NewValue);
497typeof(ItemsControl),
524((ItemsControl)d).OnItemTemplateSelectorChanged((DataTemplateSelector) e.OldValue, (DataTemplateSelector) e.NewValue);
552typeof(ItemsControl),
575ItemsControl ctrl = (ItemsControl)d;
601typeof(ItemsControl),
625ItemsControl ctrl = (ItemsControl)d;
673typeof(ItemsControl),
696((ItemsControl) d).OnItemContainerStyleChanged((Style) e.OldValue, (Style) e.NewValue);
722typeof(ItemsControl),
749((ItemsControl) d).OnItemContainerStyleSelectorChanged((StyleSelector) e.OldValue, (StyleSelector) e.NewValue);
774public static ItemsControl GetItemsOwner(DependencyObject element)
776ItemsControl container = null;
792container = panel.TemplatedParent as ItemsControl;
801ItemsControl temp;
812internal static DependencyObject GetItemsOwnerInternal(DependencyObject element, out ItemsControl itemsControl)
833itemsControl = container as ItemsControl;
847= DependencyProperty.Register("ItemsPanel", typeof(ItemsPanelTemplate), typeof(ItemsControl),
877((ItemsControl) d).OnItemsPanelChanged((ItemsPanelTemplate) e.OldValue, (ItemsPanelTemplate) e.NewValue);
892DependencyProperty.RegisterReadOnly("IsGrouping", typeof(bool), typeof(ItemsControl), new FrameworkPropertyMetadata(BooleanBoxes.FalseBox, new PropertyChangedCallback(OnIsGroupingChanged)));
914((ItemsControl)d).OnIsGroupingChanged(e);
963= DependencyProperty.Register("GroupStyleSelector", typeof(GroupStyleSelector), typeof(ItemsControl),
986((ItemsControl) d).OnGroupStyleSelectorChanged((GroupStyleSelector) e.OldValue, (GroupStyleSelector) e.NewValue);
1008typeof(ItemsControl),
1039ItemsControl ctrl = (ItemsControl) d;
1061typeof(ItemsControl),
1105typeof(ItemsControl),
1125typeof(ItemsControl),
1144public static ItemsControl ItemsControlFromItemContainer(DependencyObject container)
1151ItemsControl ic = LogicalTreeHelper.GetParent(ui) as ItemsControl;
1165return ItemsControl.GetItemsOwner(ui);
1174public static DependencyObject ContainerFromElement(ItemsControl itemsControl, DependencyObject element)
1212private static bool IsContainerForItemsControl(DependencyObject element, ItemsControl itemsControl)
1424ItemsControl ic = ItemsControlFromItemContainer(container);
1572ItemsControl ic;
1591else if ((ic = element as ItemsControl) != null)
1608ItemsControl ic;
1627else if ((ic = element as ItemsControl) != null)
1713internal void PrepareItemsControl(object item, ItemsControl parentItemsControl)
2121ItemsControl itemsControl = null;
2314ItemsControl itemsControl = GetEncapsulatingItemsControl(firstElement);
2380ItemsControl itemsControl = GetEncapsulatingItemsControl(firstElement);
2446ItemsControl itemsControl = GetEncapsulatingItemsControl(lastElement);
2474ItemsControl itemsControl = fe as ItemsControl;
3165ItemsControl itemsControl = (ItemsControl)sender;
3382private static ItemsControl GetEncapsulatingItemsControl(FrameworkElement element)
3386ItemsControl itemsControl = ItemsControl.ItemsControlFromItemContainer(element);
3398ItemsControl itemsControl = null;
3402private static object GetEncapsulatingItem(FrameworkElement element, out FrameworkElement container, out ItemsControl itemsControl)
3409itemsControl = ItemsControl.ItemsControlFromItemContainer(element);
3608else if (info.IsRemoved || !ItemsControl.EqualsEx(info.Item,
3651static (state, o, d) => ItemsControl.EqualsEx(o, state.item) && !state.claimedContainers.Contains(d),
3852if (!ItemsControl.EqualsEx(this.Item, that.Item))
System\Windows\Controls\TextSearch.cs (10)
35private TextSearch(ItemsControl itemsControl)
49internal static TextSearch EnsureInstance(ItemsControl itemsControl)
225_attachedTo.NavigateToItem(matchedItem, matchedItemIndex, new ItemsControl.ItemNavigateArgs(Keyboard.PrimaryDevice, ModifierKeys.None));
367private static int FindMatchingPrefix(ItemsControl itemsControl, string primaryTextPath, string prefix,
496internal static MatchedTextInfo FindMatchingPrefix(ItemsControl itemsControl, string prefix)
552private static string GetPrimaryTextPath(ItemsControl itemsControl)
627internal static string GetPrimaryTextFromItem(ItemsControl itemsControl, object item)
642private static BindingExpression CreateBindingExpression(ItemsControl itemsControl, object item, string primaryTextPath)
713return EnsureInstance(d as ItemsControl);
819private ItemsControl _attachedTo;
System\Windows\Controls\VirtualizingStackPanel.cs (70)
743ItemsControl itemsControl;
744ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
831ItemsControl itemsControl;
832ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
1193ElementViewportPosition elementPosition = ItemsControl.GetElementViewportPosition(
1234ItemsControl itemsControl = fe as ItemsControl;
1254ItemsControl itemsControl;
1257if ((itemsControl = fe as ItemsControl) != null)
1614ItemsControl itemsControl = ItemsControl.GetItemsOwner(this);
1678private void BringContainerIntoView(ItemsControl itemsControl, int itemIndex)
1988ItemsControl itemsControl = ItemsControl.GetItemsOwner(this);
2136ItemsControl itemsControl = null;
3289ItemsControl itemsControl = null;
3730DependencyObject itemsOwner = ItemsControl.GetItemsOwnerInternal(this);
3770ItemsControl itemsControl;
4007ItemsControl itemsControl;
4008ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
4065ItemsControl itemsControl = null;
4066DependencyObject itemsOwner = ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
4118ItemsControl itemsControl = null;
4121DependencyObject itemsOwner = ItemsControl.GetItemsOwnerInternal(itemsHost, out itemsControl);
4136out ItemsControl itemsControl,
4152ItemsControl parentItemsControl = null;
4153DependencyObject itemsOwner = ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
4161parentItemsControl = ItemsControl.GetItemsOwnerInternal(VisualTreeHelper.GetParent(itemsControl)) as ItemsControl;
4179ItemsControl.GetItemsOwnerInternal(VisualTreeHelper.GetParent(itemsOwner)) as IContainItemStorage;
4212ItemsControl itemsControl,
6498ItemsControl scrollingItemsControl = GetScrollingItemsControl(child);
6533private ItemsControl GetScrollingItemsControl(UIElement container)
6537ItemsControl parent = ItemsControl.ItemsControlFromItemContainer(container);
6546parent = ItemsControl.ItemsControlFromItemContainer(parent);
6555ItemsControl parentItemsControl = parent as ItemsControl;
9005ItemsControl itemsControl)
9021ItemsControl itemsControl,
9193ItemsControl itemsControl = ItemsControl.GetItemsOwner(this);
9373ItemsControl itemsControl = null;
9374ItemsControl.GetItemsOwnerInternal(this, out itemsControl);
9419private bool NotifyCleanupItem(int childIndex, UIElementCollection children, ItemsControl itemsControl)
9424private bool NotifyCleanupItem(UIElement child, ItemsControl itemsControl)
10978ItemsControl itemsControl;
11008ItemsControl scrollingItemsControl = ItemsControl.GetItemsOwner(this);
11085ItemsControl.GetItemsOwnerInternal(VisualTreeHelper.GetParent((Visual)itemStorageProvider)) as IContainItemStorage;
12050ItemsControl target = o as ItemsControl;
12119ItemsControl itemsControl)
12286private WeakReference<ItemsControl> _wrIC;
12293private ScrollTracer(ItemsControl itemsControl, VirtualizingStackPanel vsp, TraceList traceList)
12295_wrIC = new WeakReference<ItemsControl>(itemsControl);
12328private void IdentifyTrace(ItemsControl ic, VirtualizingStackPanel vsp)
12379if (_wrIC.TryGetTarget(out ItemsControl ic))
12395if (_wrIC.TryGetTarget(out ItemsControl ic))
12473private static List<Tuple<WeakReference<ItemsControl>,TraceList>> s_TargetToTraceListMap
12474= new List<Tuple<WeakReference<ItemsControl>,TraceList>>();
12477private static TraceList TraceListForItemsControl(ItemsControl target)
12486WeakReference<ItemsControl> wr = s_TargetToTraceListMap[i].Item1;
12487ItemsControl itemsControl;
12505private static TraceList AddToMap(ItemsControl target)
12532new Tuple<WeakReference<ItemsControl>,TraceList>(
12533new WeakReference<ItemsControl>(target),
12557WeakReference<ItemsControl> wr = s_TargetToTraceListMap[i].Item1;
12558ItemsControl unused;
13035DependencyObject parentContainer = ItemsControl.ContainerFromElement(null, vsp);
System\Windows\Data\ListCollectionView.cs (17)
758if (!System.Windows.Controls.ItemsControl.EqualsEx(newItem, SourceList[index]))
768Debug.Assert(_newItemIndex != -2 && System.Windows.Controls.ItemsControl.EqualsEx(newItem, _newItem), "AddNew did not raise expected events");
1019if (!System.Windows.Controls.ItemsControl.EqualsEx(item, _newItem))
1084if (index >= InternalCount || !System.Windows.Controls.ItemsControl.EqualsEx(item, GetItemAt(index)))
1156if (System.Windows.Controls.ItemsControl.EqualsEx(item, _newItem))
1342if (!System.Windows.Controls.ItemsControl.EqualsEx(item, _editItem))
1894(IsAddingNew && System.Windows.Controls.ItemsControl.EqualsEx(_newItem, newItem)));
1932System.Windows.Controls.ItemsControl.EqualsEx(ItemFrom(InternalList[localOldIndex]), oldItem))
1985bool simpleMove = System.Windows.Controls.ItemsControl.EqualsEx(oldItem, newItem);
1994System.Windows.Controls.ItemsControl.EqualsEx(InternalList[localOldIndex], oldItem))
2166else if (IsAddingNew && System.Windows.Controls.ItemsControl.EqualsEx(item, _newItem))
2648System.Windows.Controls.ItemsControl.EqualsEx(item, _newItem))
2675if (!System.Windows.Controls.ItemsControl.EqualsEx(item, ilFull[index]))
2774if (System.Windows.Controls.ItemsControl.EqualsEx(ilFull[fullIndex], ilPartial[localIndex]))
2780else if (System.Windows.Controls.ItemsControl.EqualsEx(item, ilPartial[localIndex]))
2967if (!IsAddingNew || !System.Windows.Controls.ItemsControl.EqualsEx(_newItem, item))
3179if (System.Windows.Controls.ItemsControl.EqualsEx(item, ilFull[index]))