예제 #1
0
 /// <summary>
 /// You can override this method while View was detached from window
 /// </summary>
 /// <param name="bindAble">A sampleView type of bindAble</param>
 protected override void OnDetachingFrom(SampleView bindAble)
 {
     this.datagrid  = null;
     this.datapager = null;
     this.viewModel = null;
     base.OnDetachingFrom(bindAble);
 }
예제 #2
0
        /// <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.viewModel                   = new DataPagerViewModel();
            bindAble.BindingContext          = this.viewModel;
            this.datagrid                    = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid");
            this.datapager                   = bindAble.FindByName <SfDataPager>("dataPager");
            this.datapager.PageSize          = 20;
            this.datapager.Source            = this.viewModel.OrdersInfo;
            this.datagrid.ItemsSource        = this.datapager.PagedSource;
            this.datapager.AppearanceManager = new PagerAppearance();
            if (Device.RuntimePlatform == Device.UWP || Device.Idiom == TargetIdiom.Tablet || Device.RuntimePlatform == Device.macOS)
            {
                this.datapager.NumericButtonCount = 14;
            }
            else if (Device.Idiom == TargetIdiom.Phone)
            {
                this.datapager.NumericButtonCount = 6;
            }

            if (Device.RuntimePlatform == Device.UWP)
            {
                this.datapager.HeightRequest = 50;
            }

            base.OnAttachedTo(bindAble);
        }
예제 #3
0
        /// <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.viewModel          = new DataPagerViewModel();
            bindAble.BindingContext = this.viewModel;
            this.datagrid           = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid");
            this.datapager          = bindAble.FindByName <SfDataPager>("dataPager");
            this.selectionPicker    = bindAble.FindByName <PickerExt>("SelectionPicker");
            this.selectionPicker.Items.Add("Rectangle");
            this.selectionPicker.Items.Add("Circle");
            this.selectionPicker.SelectedIndexChanged += this.SelectionPicker_SelectedIndexChanged;
            this.datapager.PageSize          = 20;
            this.datapager.Source            = this.viewModel.OrdersInfo;
            this.datagrid.ItemsSource        = this.datapager.PagedSource;
            this.datapager.AppearanceManager = new PagerAppearance();
            (this.datapager.Children[1] as ScrollView).Scrolled += this.PagingBehavior_Scrolled;
            if (Device.RuntimePlatform == Device.UWP || Device.Idiom == TargetIdiom.Tablet || Device.RuntimePlatform == Device.macOS)
            {
                this.datapager.NumericButtonCount = 12;
            }
            else if (Device.Idiom == TargetIdiom.Phone || Device.RuntimePlatform == Device.WPF)
            {
                this.datapager.NumericButtonCount = 6;
            }

            if (Device.RuntimePlatform == Device.UWP)
            {
                this.datapager.HeightRequest = 50;
            }

            base.OnAttachedTo(bindAble);
        }
예제 #4
0
 protected override void OnDetachingFrom(SampleView bindable)
 {
     datagrid  = null;
     datapager = null;
     viewModel = null;
     base.OnDetachingFrom(bindable);
 }
예제 #5
0
 /// <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.viewModel          = new DataPagerViewModel();
     this.samplePage         = bindAble;
     bindAble.BindingContext = this.viewModel;
     this.InitPager(bindAble);
     base.OnAttachedTo(bindAble);
 }
예제 #6
0
 /// <summary>
 /// You can override this method while View was detached from window
 /// </summary>
 /// <param name="bindAble">A sampleView type of bindAble</param>
 protected override void OnDetachingFrom(SampleView bindAble)
 {
     this.selectionPicker.SelectedIndexChanged -= this.SelectionPicker_SelectedIndexChanged;
     this.datagrid  = null;
     this.datapager = null;
     this.viewModel = null;
     base.OnDetachingFrom(bindAble);
 }
예제 #7
0
 /// <summary>
 /// You can override this method while View was detached from window
 /// </summary>
 /// <param name="bindAble">A sampleView type of bindAble</param>
 protected override void OnDetachingFrom(SampleView bindAble)
 {
     this.selectionPicker.SelectedIndexChanged           -= this.SelectionPicker_SelectedIndexChanged;
     (this.datapager.Children[1] as ScrollView).Scrolled -= this.PagingBehavior_Scrolled;
     this.datagrid  = null;
     this.datapager = null;
     this.viewModel = null;
     base.OnDetachingFrom(bindAble);
 }