protected override void OnDetachingFrom(SfListView bindable) { ListView.SwipeStarted -= ListView_SwipeStarted; ListView.SwipeEnded -= ListView_SwipeEnded; ListView.PropertyChanged -= ListView_PropertyChanged; ListView = null; SwipingViewModel = null; base.OnDetachingFrom(bindable); }
protected override void OnAttachedTo(SfListView bindable) { ListView = bindable; ListView.SwipeStarted += ListView_SwipeStarted; ListView.SwipeEnded += ListView_SwipeEnded; ListView.PropertyChanged += ListView_PropertyChanged; SwipingViewModel = new ListViewSwipingViewModel(); SwipingViewModel.sfListView = ListView; bindable.BindingContext = SwipingViewModel; ListView.ItemsSource = SwipingViewModel.InboxInfo; base.OnAttachedTo(bindable); }
protected override void OnAttachedTo(ContentPage bindable) { viewModel = new ListViewSwipingViewModel(); firstLV = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("firstLV"); secondLV = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("secondLV"); button = bindable.FindByName <Button>("Reset"); sfPullToRefresh = bindable.FindByName <SfPullToRefresh>("pullToRefresh"); sfPullToRefresh.Refreshing += SfPullToRefresh_Refreshing; firstLV.BindingContext = viewModel; secondLV.BindingContext = viewModel; button.BindingContext = viewModel; firstLV.ItemsSource = viewModel.FirstLVCollection; firstLV.ItemsSource = viewModel.SecondLVCollection; viewModel.firstLV = firstLV; viewModel.secondLV = secondLV; base.OnAttachedTo(bindable); }