/// <summary> /// You can override this method while View was detached from window /// </summary> /// <param name="bindAble">bindAble Object type of bindAble</param> protected override void OnDetachingFrom(BindableObject bindAble) { this.transitionType.SelectedIndexChanged -= this.OnSelectionChanged; this.pullToRefresh.Refreshing -= this.PullToRefresh_Refreshing; this.pullToRefresh = null; this.datagrid = null; this.viewModel = null; base.OnDetachingFrom(bindAble); }
/// <summary> /// You can override this method to subscribe to AssociatedObject events and initialize properties. /// </summary> /// <param name="bindAble">SampleView type of bindAble</param> protected override void OnAttachedTo(SampleView bindAble) { this.datagrid = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); this.getGettingStartedViewModel = new DataBindingViewModel(); this.selectionPicker = bindAble.FindByName <PickerExt>("SelectionPicker"); this.selectionPicker.Items.Add("Observable Collection"); this.selectionPicker.Items.Add("DataTable"); this.selectionPicker.SelectedIndexChanged += this.SelectionPicker_SelectedIndexChanged; base.OnAttachedTo(bindAble); }
/// <summary> /// You can override this method to subscribe to AssociatedObject events and initialize properties. /// </summary> /// <param name="bindAble">SampleView type of parameter bindAble</param> protected override void OnAttachedTo(SampleView bindAble) { this.viewModel = new DataBindingViewModel(); bindAble.BindingContext = this.viewModel; this.pullToRefresh = bindAble.FindByName <Syncfusion.SfPullToRefresh.XForms.SfPullToRefresh>("pullToRefresh"); this.datagrid = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); this.datagrid.ItemsSource = this.viewModel.OrdersInfo; this.transitionType = bindAble.FindByName <PickerExt>("transitionType"); this.datagrid.ItemsSource = this.viewModel.OrdersInfo; this.transitionType.Items.Add("SlideOnTop"); this.transitionType.Items.Add("Push"); this.transitionType.SelectedIndex = 0; this.transitionType.SelectedIndexChanged += this.OnSelectionChanged; this.pullToRefresh.Refreshing += this.PullToRefresh_Refreshing; if (Device.RuntimePlatform == Device.UWP) { this.pullToRefresh.ProgressBackgroundColor = Color.FromHex("0065ff"); this.pullToRefresh.ProgressStrokeColor = Color.FromHex("#ffffff"); } base.OnAttachedTo(bindAble); }