257 references to NewItems
Microsoft.AspNetCore.Components.WebView.Maui (1)
BlazorWebViewHandler.cs (1)
119 var newItems = eventArgs.NewItems!.Cast<RootComponent>();
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
BlazorWebView.cs (1)
229 var newItems = (eventArgs.NewItems ?? Array.Empty<object>()).Cast<RootComponent>();
Microsoft.AspNetCore.Components.WebView.Wpf (1)
BlazorWebView.cs (1)
316 var newItems = (eventArgs.NewItems ?? Array.Empty<RootComponent>()).Cast<RootComponent>();
Microsoft.Maui.Controls (110)
BindableLayout\BindableLayout.cs (1)
503 foreach (var item in e.NewItems!)
Compatibility\Handlers\ListView\iOS\ListViewRenderer.cs (1)
571 InsertRows(e.NewStartingIndex, e.NewItems.Count, section);
Compatibility\Handlers\Shell\iOS\ShellItemRenderer.cs (2)
204 if (e.NewItems != null && e.NewItems.Count > 0)
Compatibility\Handlers\Shell\iOS\ShellSearchResultsRenderer.cs (1)
193 TableView.InsertRows(GetPaths(section, e.NewStartingIndex, e.NewItems.Count), InsertRowsAnimation);
Compatibility\Handlers\Shell\iOS\ShellSectionRootRenderer.cs (2)
528 if (e.NewItems != null) 530 foreach (ShellContent newItem in e.NewItems)
Element\Element.cs (4)
852 foreach (Effect effect in e.NewItems) 866 foreach (Effect effect in e.NewItems) 876 if (e.NewItems != null) 878 foreach (Effect effect in e.NewItems)
FormattedString.cs (2)
56 if (e.NewItems != null) 58 foreach (object item in e.NewItems)
GestureElement.cs (1)
23 foreach (IElementDefinition item in args.NewItems.OfType<IElementDefinition>())
GradientBrush.cs (2)
87 if (e.NewItems != null) 89 foreach (var newItem in e.NewItems)
Handlers\Items\iOS\ObservableGroupedSource.cs (5)
235 var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : _groupSource.IndexOf(args.NewItems[0]); 236 var count = args.NewItems.Count; 279 var newCount = args.NewItems.Count; 285 var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : _groupSource.IndexOf(args.NewItems[0]); 299 var count = args.NewItems.Count;
Handlers\Items\iOS\ObservableItemsSource.cs (5)
204 var count = args.NewItems.Count; 206 var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : IndexOf(args.NewItems[0]); 231 var newCount = args.NewItems.Count; 235 var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : IndexOf(args.NewItems[0]); 250 var count = args.NewItems.Count;
Internals\NotifyCollectionChangedEventArgsExtensions.cs (6)
42 for (var i = 0; i < self.NewItems.Count; i++) 43 insert(self.NewItems[i], i + self.NewStartingIndex, true); 72 if (self.OldStartingIndex < 0 || self.OldItems.Count != self.NewItems.Count) 78 insert(self.NewItems[i], i + self.OldStartingIndex, true); 96 return new NotifyCollectionChangedEventArgsEx(count, NotifyCollectionChangedAction.Add, e.NewItems, e.NewStartingIndex); 105 return new NotifyCollectionChangedEventArgsEx(count, NotifyCollectionChangedAction.Replace, e.NewItems, e.OldItems, e.OldStartingIndex);
Items\MarshalingObservableCollection.cs (2)
118 foreach (var item in args.NewItems) 130 foreach (var item in args.NewItems)
Label\Label.cs (4)
319 SetupSpans(e.NewItems); 326 SetupSpans(e.NewItems); 340 SetupSpanGestureRecognizers(e.NewItems); 347 SetupSpanGestureRecognizers(e.NewItems);
LegacyLayouts\Layout.cs (3)
639 if (e.NewItems != null) 641 for (int i = 0; i < e.NewItems.Count; i++) 643 object item = e.NewItems[i];
MultiPage.cs (5)
230 SetIndex((T)InternalChildren[i], i + e.NewItems.Count); 232 for (var i = 0; i < e.NewItems.Count; i++) 234 var page = (T)e.NewItems[i]; 238 InternalChildren.Insert(index, (T)e.NewItems[i]); 310 T page = _templatedItems.GetOrCreateContent(i, e.NewItems[i - e.OldStartingIndex]);
ObservableWrapper.cs (8)
181 if (e.NewStartingIndex == -1 || e.NewItems.Count > 1) 184 var newItem = e.NewItems[0] as TRestrict; 189 handler(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, e.NewItems, outerIndex)); 192 if (e.NewStartingIndex == -1 || e.OldStartingIndex == -1 || e.NewItems.Count > 1) 195 var movedItem = e.NewItems[0] as TRestrict; 201 handler(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, e.NewItems, outerNewIndex, outerOldIndex)); 216 if (e.NewStartingIndex == -1 || e.OldStartingIndex == -1 || e.NewItems.Count > 1) 219 var newReplaceItem = e.NewItems[0] as TRestrict;
Page\Page.cs (4)
743 if (e.NewItems != null) 747 foreach (Element item in e.NewItems) 781 if (args.NewItems != null) 783 foreach (IElementDefinition item in args.NewItems)
Picker\Picker.cs (1)
311 foreach (object newItem in e.NewItems)
ResourceDictionary.cs (2)
126 if (e.NewItems != null) 128 foreach (var item in e.NewItems)
Shapes\GeometryGroup.cs (2)
84 if (e.NewItems != null) 86 foreach (var newItem in e.NewItems)
Shapes\PathFigure.cs (2)
119 if (e.NewItems != null) 121 foreach (var newItem in e.NewItems)
Shapes\PathGeometry.cs (2)
223 if (e.NewItems != null) 225 foreach (var newItem in e.NewItems)
Shapes\TransformGroup.cs (2)
46 if (args.NewItems != null) 47 foreach (INotifyPropertyChanged item in args.NewItems)
Shell\BaseShellItem.cs (2)
67 if (args.NewItems != null) 68 foreach (Element element in args.NewItems)
Shell\ShellContent.cs (2)
327 if (e.NewItems != null) 328 foreach (Element el in e.NewItems)
Shell\ShellElementCollection.cs (5)
47 if (args?.NewItems?.Count > 0 && _pauseCollectionChanged) 90 var pendingEvents = _notifyCollectionChangedEventArgs.OrderBy(x => x.NewItems != null ? 0 : 1).ToList(); 147 if (e.NewItems != null) 149 foreach (BaseShellItem element in e.NewItems) 259 foreach (BaseShellItem bsi in (e.NewItems ?? e.OldItems ?? Inner))
Shell\ShellItem.cs (4)
164 if (args.NewItems != null) 166 foreach (Element item in args.NewItems) 309 if (e.NewItems != null) 311 foreach (Element element in e.NewItems)
Shell\ShellSection.cs (2)
229 if (args.NewItems != null) 231 foreach (Element item in args.NewItems)
SwipeView\SwipeItems.cs (2)
131 if (notifyCollectionChangedEventArgs.NewItems is not null) 133 foreach (var item in notifyCollectionChangedEventArgs.NewItems)
TableView\TableRoot.cs (2)
44 if (args.NewItems != null) 46 foreach (TableSection section in args.NewItems)
TableView\TableSection.cs (2)
150 if (notifyCollectionChangedEventArgs.NewItems == null) 153 foreach (BindableObject item in notifyCollectionChangedEventArgs.NewItems)
TableView\TableView.cs (1)
161 childCollectionChangedEventArgs.Args.NewItems?.Cast<Cell>().ForEach(cell => cell.Parent = this);
TemplatedItemsList.cs (17)
805 SetIndex(_templatedObjects[i], i + e.NewItems.Count); 807 newItems = new List<TemplatedItemsList<TView, TItem>>(e.NewItems.Count); 809 for (var i = 0; i < e.NewItems.Count; i++) 811 TemplatedItemsList<TView, TItem> converted = InsertGrouped(e.NewItems[i], e.NewStartingIndex + i); 848 newItems = new List<TemplatedItemsList<TView, TItem>>(e.NewItems.Count); 861 newItems.Add(InsertGrouped(e.NewItems[i], index)); 999 if (e.NewStartingIndex >= 0 && e.NewItems != null) 1000 maxindex = Math.Max(maxindex, e.NewStartingIndex + e.NewItems.Count); 1012 SetIndex(_templatedObjects[i], i + e.NewItems.Count); 1014 _templatedObjects.InsertRange(e.NewStartingIndex, Enumerable.Repeat<TItem>(null, e.NewItems.Count)); 1016 IList items = ConvertContent(e.NewStartingIndex, e.NewItems, true, true); 1089 IList newItems = ConvertContent(e.NewStartingIndex, e.NewItems, true, true); 1171 for (var i = 0; i < e.NewItems.Count; i++) 1172 OnProxyCollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, e.NewItems[i], e.NewStartingIndex + i)); 1190 OnProxyCollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, e.NewItems[i], e.OldItems[i], e.OldStartingIndex + i)); 1344 e = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, ConvertItems(e.NewItems), e.NewStartingIndex); 1356 e = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, ConvertItems(e.NewItems), ConvertItems(e.OldItems), e.OldStartingIndex);
View\View.cs (2)
124 AddItems(args.NewItems); 130 AddItems(args.NewItems);
Microsoft.Maui.Controls.Compatibility (11)
iOS\CollectionView\ObservableGroupedSource.cs (5)
188 var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : _groupSource.IndexOf(args.NewItems[0]); 189 var count = args.NewItems.Count; 230 var newCount = args.NewItems.Count; 236 var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : _groupSource.IndexOf(args.NewItems[0]); 250 var count = args.NewItems.Count;
iOS\CollectionView\ObservableItemsSource.cs (5)
155 var count = args.NewItems.Count; 157 var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : _itemsSource.IndexOf(args.NewItems[0]); 184 var newCount = args.NewItems.Count; 188 var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : _itemsSource.IndexOf(args.NewItems[0]); 203 var count = args.NewItems.Count;
iOS\Renderers\ListViewRenderer.cs (1)
597 InsertRows(e.NewStartingIndex, e.NewItems.Count, section);
Microsoft.Maui.Controls.Maps (4)
Map.cs (4)
229 if (e.NewItems is not null && e.NewItems.Cast<Pin>().Any(pin => pin.Label is null)) 240 if (e.NewItems is not null) 242 foreach (MapElement item in e.NewItems)
Microsoft.VisualStudio.LanguageServices (1)
ValueTracking\TreeViewItemBase.cs (1)
116SetParents(args.NewItems, this);
PresentationFramework (108)
MS\Internal\Data\CompositeCollectionView.cs (13)
400item = args.NewItems[0]; 488CollectionContainer newCollectionContainer = args.NewItems[0] as CollectionContainer; 508args = new NotifyCollectionChangedEventArgs(args.Action, args.NewItems, args.OldItems, startingIndex); 715TraceLog.IdFor(sender), args.Action, TraceLog.IdFor(args.OldItems[0]), TraceLog.IdFor(args.NewItems[0])); 728TraceContainerCollectionChange(sender, args.Action, null, args.NewItems[0]); 736args = new NotifyCollectionChangedEventArgs(args.Action, args.NewItems[0], flatNewIndex); 752TraceContainerCollectionChange(sender, args.Action, args.OldItems[0], args.NewItems[0]); 756args = new NotifyCollectionChangedEventArgs(args.Action, args.NewItems[0], args.OldItems[0], flatOldIndex); 760TraceContainerCollectionChange(sender, args.Action, args.OldItems[0], args.NewItems[0]); 764flatOldIndex = DeduceFlatIndexForRemove((CollectionContainer)sender, x, args.NewItems[0]); 1434if (e.NewItems.Count != 1) 1444if (e.NewItems.Count != 1 || e.OldItems.Count != 1) 1449if (e.NewItems.Count != 1)
MS\Internal\Data\EnumerableCollectionView.cs (6)
405for (int i = 0; i < args.NewItems.Count; ++i) 407_snapshot.Add(args.NewItems[i]); 412for (int i = args.NewItems.Count - 1; i >= 0; --i) 414_snapshot.Insert(args.NewStartingIndex, args.NewItems[i]); 433for (int i = args.NewItems.Count - 1, index = args.NewStartingIndex + i; i >= 0; --i, --index) 438_snapshot[index] = args.NewItems[i];
System\Windows\Annotations\Annotation.cs (6)
706changedItems = e.NewItems; 722changedItems = e.NewItems; 760changedItems = e.NewItems; 776changedItems = e.NewItems; 809changedItems = e.NewItems; 825changedItems = e.NewItems;
System\Windows\Controls\DataGrid.cs (13)
228UpdateDataGridReference(e.NewItems, /* clear = */ false); 229UpdateColumnSizeConstraints(e.NewItems); 238UpdateDataGridReference(e.NewItems, /* clear = */ false); 239UpdateColumnSizeConstraints(e.NewItems); 256visibleColumnsChanged |= HasVisibleColumns(e.NewItems); 949foreach (ValidationRule rule in e.NewItems) 970foreach (ValidationRule rule in e.NewItems) 7251Debug.Assert(e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7282Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7396Debug.Assert(e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7397if (CanConvertToSortDescription(e.NewItems[0] as PropertyGroupDescription)) 7415Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7417CanConvertToSortDescription(e.NewItems[0] as PropertyGroupDescription))
System\Windows\Controls\DataGridColumnCollection.cs (4)
91UpdateDisplayIndexForNewColumns(e.NewItems, e.NewStartingIndex); 111ClearDisplayIndex(e.OldItems, e.NewItems); 118UpdateDisplayIndexForReplacedColumn(e.OldItems, e.NewItems); 121ClearDisplayIndex(e.OldItems, e.NewItems);
System\Windows\Controls\DataGridColumnHeaderCollection.cs (2)
211newArgs = new NotifyCollectionChangedEventArgs(e.Action, HeadersFromColumns(e.NewItems), e.NewStartingIndex); 223newArgs = new NotifyCollectionChangedEventArgs(e.Action, HeadersFromColumns(e.NewItems), HeadersFromColumns(e.OldItems), e.OldStartingIndex);
System\Windows\Controls\GridViewHeaderRowPresenter.cs (2)
706column = (GridViewColumn)(e.NewItems[0]); 721column = (GridViewColumn)(e.NewItems[0]);
System\Windows\Controls\GridViewRowPresenter.cs (2)
375InternalChildren.AddInternal(CreateCell((GridViewColumn)(e.NewItems[0]))); 384InternalChildren.AddInternal(CreateCell((GridViewColumn)(e.NewItems[0])));
System\Windows\Controls\ItemCollection.cs (8)
2174if (clone.Count + e.NewItems.Count != origin.Count) 2176for (int i = 0; i < e.NewItems.Count; i++) 2178clone.Insert(e.NewStartingIndex + i, (T)e.NewItems[i]); 2197clone[e.OldStartingIndex + i] = (T)e.NewItems[i]; 2205if (e.NewItems.Count == 1) 2208clone.Insert(e.NewStartingIndex, (T)e.NewItems[0]); 2216for (int i = 0; i < e.NewItems.Count; i++) 2218clone.Insert(e.NewStartingIndex + i, (T)e.NewItems[i]);
System\Windows\Controls\ItemContainerGenerator.cs (3)
2394if (args.NewItems.Count != 1) 2396OnItemAdded(args.NewItems[0], args.NewStartingIndex); 2412OnItemReplaced(args.OldItems[0], args.NewItems[0], args.NewStartingIndex);
System\Windows\Controls\MultipleCopiesCollection.cs (3)
51e.NewItems.Count == 1, 58e.NewItems.Count == 1, 72e.NewItems.Count == 1,
System\Windows\Controls\Primitives\Selector.cs (5)
873if (e.NewItems.Count != 1) 876SelectionChange.Select(NewUnresolvedItemInfo(e.NewItems[0]), false /* assumeInItemsCollection */); 902if (e.NewItems.Count != 1 || e.OldItems.Count != 1) 906SelectionChange.Select(NewUnresolvedItemInfo(e.NewItems[0]), false /* assumeInItemsCollection */); 1146ItemInfo info = NewItemInfo(e.NewItems[0], null, e.NewStartingIndex);
System\Windows\Data\BindingGroup.cs (2)
1304bindingExpr = e.NewItems[0] as BindingExpressionBase; 1316bindingExpr = e.NewItems[0] as BindingExpressionBase;
System\Windows\Data\BindingListCollectionView.cs (8)
1503BeginAddNew(args.NewItems[0], args.NewStartingIndex); 1507AddItemToGroups(args.NewItems[0]); 1529AddItemToGroups(args.NewItems[0]); 1813_shadowList.Insert(e.NewStartingIndex, e.NewItems[0]); 1819_shadowList[e.OldStartingIndex] = e.NewItems[0]; 2434if (e.NewItems.Count != 1) 2444if (e.NewItems.Count != 1 || e.OldItems.Count != 1) 2449if (e.NewItems.Count != 1)
System\Windows\Data\CollectionView.cs (6)
1082if (PassesFilter(args.NewItems[0])) 1098if (PassesFilter(args.OldItems[0]) || PassesFilter(args.NewItems[0])) 1106if (PassesFilter(args.NewItems[0])) 1952if (e.NewItems.Count != 1) 1964if (e.NewItems.Count != 1 || e.OldItems.Count != 1) 1969if (e.NewItems.Count != 1)
System\Windows\Data\ListCollectionView.cs (16)
1723BeginAddNew(args.NewItems[0], args.NewStartingIndex); 1731adjustedNewIndex = AdjustBefore(NotifyCollectionChangedAction.Add, args.NewItems[0], args.NewStartingIndex); 1868object newItem = (args.NewItems != null && args.NewItems.Count > 0) ? args.NewItems[0] : null; 1972args = new NotifyCollectionChangedEventArgs(effectiveAction, args.NewItems[0], args.OldItems[0], adjustedOldIndex); 2041args2 = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, args.NewItems, adjustedNewIndex); 2371ShadowCollection.Insert(e.NewStartingIndex, e.NewItems[0]); 2375ShadowCollection.Add(e.NewItems[0]); 2391ShadowCollection[e.OldStartingIndex] = e.NewItems[0]; 2398ShadowCollection[tempIndex] = e.NewItems[0]; 2405tempIndex = ShadowCollection.IndexOf(e.NewItems[0]); 2408ShadowCollection.Insert(e.NewStartingIndex, e.NewItems[0]); 2501if (e.NewItems.Count != 1) 2511if (e.NewItems.Count != 1 || e.OldItems.Count != 1) 2516if (e.NewItems.Count != 1)
System\Windows\Documents\DocumentSequence.cs (2)
716if (args.NewItems.Count != 1) 723object item = args.NewItems[0];
System\Windows\Documents\DocumentSequenceTextContainer.cs (2)
594if (args.NewItems.Count != 1) 600object item = args.NewItems[0];
System\Windows\ResourceDictionary.cs (5)
1854(e.NewItems != null && e.NewItems.Count > 0) || 1884newDictionaries = new List<ResourceDictionary>(e.NewItems.Count); 1886for (int i = 0; i < e.NewItems.Count; i++) 1888mergedDictionary = (ResourceDictionary)e.NewItems[i];
WindowsBase.Tests (20)
System\ComponentModel\SortDescriptionCollectionTests.cs (20)
91Assert.Null(events[0].NewItems); 96Assert.Equal(new[] { description2 }, events[1].NewItems!.Cast<SortDescription>()); 177Assert.Equal(new[] { description1 }, events[0].NewItems!.Cast<SortDescription>()); 191Assert.Equal(new[] { description1 }, events[0].NewItems!.Cast<SortDescription>()); 256Assert.Equal(new[] { description1 }, events[0].NewItems!.Cast<SortDescription>()); 270Assert.Equal(new[] { description2 }, events[1].NewItems!.Cast<SortDescription>()); 345Assert.Equal(new[] { description1 }, events[0].NewItems!.Cast<SortDescription>()); 359Assert.Equal(new[] { description2 }, events[1].NewItems!.Cast<SortDescription>()); 425Assert.Null(events[0].NewItems); 438Assert.Null(events[2].NewItems); 448Assert.Null(events[3].NewItems); 497Assert.Null(events[0].NewItems); 510Assert.Null(events[2].NewItems); 520Assert.Null(events[3].NewItems); 583Assert.Null(events[0].NewItems); 595Assert.Null(events[1].NewItems); 669Assert.Null(events[0].NewItems); 681Assert.Null(events[1].NewItems); 747Assert.Null(events[0].NewItems); 752Assert.Equal(new[] { description2 }, events[1].NewItems!.Cast<SortDescription>());