/// <summary> /// You can override this method while View was detached from window /// </summary> /// <param name="bindAble">Sample View typed parameter named as bindAble</param> protected override void OnAttachedTo(SampleView bindAble) { this.viewModel = new PullToRefreshViewModel(); bindAble.BindingContext = this.viewModel; this.pullToRefresh = bindAble.FindByName <SfPullToRefresh>("pullToRefresh"); this.subGrid1 = bindAble.FindByName <Grid>("SubGrid1"); this.subGrid2 = bindAble.FindByName <Grid>("SubGrid2"); this.listView = bindAble.FindByName <SfListView>("listView"); this.transitionType = bindAble.FindByName <PickerExt>("transitionType"); this.label2 = bindAble.FindByName <Label>("label2"); this.label3 = bindAble.FindByName <Label>("label3"); this.imagedata = bindAble.FindByName <Image>("imagedata"); this.subGrid1.BindingContext = this.viewModel.Data; this.pullToRefresh.PullingThreshold = 100; this.listView.ItemsSource = this.viewModel.SelectedData; if (Device.RuntimePlatform == Device.iOS) { this.pullToRefresh.SizeChanged += this.Pull_SizeChanged; } this.pullToRefresh.Refreshing += this.PullToRefresh_Refreshing; this.pullToRefresh.Refreshed += this.PullToRefresh_Refreshed; this.listView.SelectionChanging += this.ListView_SelectionChanging; this.transitionType.Items.Add("Push"); this.transitionType.Items.Add("SlideOnTop"); this.transitionType.SelectedIndex = 1; this.transitionType.SelectedIndexChanged += this.OnSelectionChanged; base.OnAttachedTo(bindAble); }
/// <summary> /// You can override this method while View was detached from window /// </summary> /// <param name="bindAble">SampleView typed parameter named as bindAble</param> protected override void OnDetachingFrom(SampleView bindAble) { this.pullToRefresh.SizeChanged -= this.Pull_SizeChanged; this.pullToRefresh.Refreshing -= this.PullToRefresh_Refreshing; this.pullToRefresh.Refreshed -= this.PullToRefresh_Refreshed; this.listView.SelectionChanging -= this.ListView_SelectionChanging; this.transitionType.SelectedIndexChanged -= this.OnSelectionChanged; this.pullToRefresh = null; this.viewModel = null; this.listView = null; this.subGrid1 = null; this.subGrid2 = null; this.transitionType = null; this.label2 = null; this.label3 = null; this.imagedata = null; base.OnDetachingFrom(bindAble); }
protected override void OnDetachingFrom(SampleView bindable) { pullToRefresh.SizeChanged -= Pull_SizeChanged; pullToRefresh.Refreshing -= PullToRefresh_Refreshing; pullToRefresh.Refreshed -= PullToRefresh_Refreshed; listView.SelectionChanging -= ListView_SelectionChanging; transitionType.SelectedIndexChanged -= OnSelectionChanged; pullToRefresh = null; viewModel = null; listView = null; SubGrid1 = null; SubGrid2 = null; transitionType = null; label2 = null; label3 = null; imagedata = null; base.OnDetachingFrom(bindable); }