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); }); }
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); } }
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; }
void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e) { e.Apply(Element.Children, Control.Items); // Potential performance issue, UpdateLayout () is called for every page change Control.UpdateLayout(); }
void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e) { e.Apply(Page.Children, _tabs.Items); }
void OnChildrenChanged(object sender, NotifyCollectionChangedEventArgs e) { e.Apply(Element.Children, Items); }