本文整理匯總了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);
}