本文整理汇总了C#中System.Collections.Specialized.NotifyCollectionChangedEventArgs.Apply方法的典型用法代码示例。如果您正苦于以下问题:C# NotifyCollectionChangedEventArgs.Apply方法的具体用法?C# NotifyCollectionChangedEventArgs.Apply怎么用?C# NotifyCollectionChangedEventArgs.Apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Specialized.NotifyCollectionChangedEventArgs
的用法示例。
在下文中一共展示了NotifyCollectionChangedEventArgs.Apply方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Vms_CollectionChanged
private void Vms_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) {
var collection = (IList)sender;
e.Apply(
//insert
(o, i, b) => {
Insert(o, i, b);
},
//remove
(o, i) => {
Remove(o, i);
},
//reset
() => {
Reset(collection);
});
}
示例2: OnPagesChanged
void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
_ignoreNativeScrolling = true;
NotifyCollectionChangedAction action = e.Apply((o, i, c) => InsertPage((ContentPage)o, i), (o, i) => RemovePage((ContentPage)o, i), Reset);
PositionChildren();
_ignoreNativeScrolling = false;
if (action == NotifyCollectionChangedAction.Reset)
{
int index = Carousel.CurrentPage != null ? CarouselPage.GetIndex(Carousel.CurrentPage) : 0;
if (index < 0)
index = 0;
ScrollToPage(index);
}
}
示例3: OnPagesChanged
void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
e.Apply((o, i, c) => SetupPage((Page)o, i), (o, i) => TeardownPage((Page)o, i), Reset);
SetControllers();
UIViewController controller = null;
if (Tabbed.CurrentPage != null)
controller = GetViewController(Tabbed.CurrentPage);
if (controller != null && controller != base.SelectedViewController)
base.SelectedViewController = controller;
}
示例4: OnPagesChanged
void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
e.Apply(Element.Children, Control.Items);
// Potential performance issue, UpdateLayout () is called for every page change
Control.UpdateLayout();
}
示例5: OnPagesChanged
void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
e.Apply(Page.Children, _tabs.Items);
}
示例6: OnChildrenChanged
void OnChildrenChanged(object sender, NotifyCollectionChangedEventArgs e)
{
e.Apply(Element.Children, Items);
}