/// <summary>
 /// You can override this method to subscribe to AssociatedObject events and initialize properties.
 /// </summary>
 /// <param name="bindAble">SampleView type parameter named as bindAble</param>
 protected override void OnAttachedTo(SampleView bindAble)
 {
     this.viewModel            = new DataGridPullToRefreshViewModel();
     bindAble.BindingContext   = this.viewModel;
     this.pullToRefresh        = bindAble.FindByName <SfPullToRefresh>("pullToRefresh");
     this.dataGrid             = bindAble.FindByName <SfDataGrid>("dataGrid");
     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;
     this.pullToRefresh.Pulling += this.PullToRefresh_Pulling;
     base.OnAttachedTo(bindAble);
 }
Пример #2
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            viewModel = new DataGridPullToRefreshViewModel();
            bindable.BindingContext = viewModel;
            pullToRefresh           = bindable.FindByName <Syncfusion.SfPullToRefresh.XForms.SfPullToRefresh>("pullToRefresh");
            dataGrid             = bindable.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid> ("dataGrid");
            transitionType       = bindable.FindByName <PickerExt>("transitionType");
            dataGrid.ItemsSource = viewModel.OrdersInfo;
            transitionType.Items.Add("SlideOnTop");
            transitionType.Items.Add("Push");
            transitionType.SelectedIndex         = 0;
            transitionType.SelectedIndexChanged += OnSelectionChanged;
            pullToRefresh.Refreshing            += PullToRefresh_Refreshing;

            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 parameter named as bindAble</param>
        protected override void OnAttachedTo(SampleView bindAble)
        {
            this.viewModel   = new DataGridPullToRefreshViewModel();
            this.progressbar = new SfCircularProgressBar();
            this.border      = new SfBorder();

            this.border.BorderColor     = Color.LightGray;
            this.border.BackgroundColor = Color.White;
            this.border.CornerRadius    = 35;
            this.border.Content         = this.progressbar;
            this.border.BorderWidth     = 0.2;

            this.progressbar.SegmentCount                   = 10;
            this.progressbar.IndicatorInnerRadius           = 0.5;
            this.progressbar.IndicatorOuterRadius           = 0.7;
            this.progressbar.ShowProgressValue              = true;
            this.progressbar.GapWidth                       = 0.5;
            this.progressbar.WidthRequest                   = 70;
            this.progressbar.HeightRequest                  = 55;
            this.progressbar.IndeterminateAnimationDuration = 750;

            bindAble.BindingContext   = this.viewModel;
            this.pullToRefresh        = bindAble.FindByName <SfPullToRefresh>("pullToRefresh");
            this.dataGrid             = bindAble.FindByName <SfDataGrid>("dataGrid");
            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;
            this.pullToRefresh.Pulling += this.PullToRefresh_Pulling;

            var pullingTemplate = new DataTemplate(() =>
            {
                return(new ViewCell {
                    View = this.border
                });
            });

            this.pullToRefresh.PullingViewTemplate    = pullingTemplate;
            this.pullToRefresh.RefreshingViewTemplate = pullingTemplate;

            base.OnAttachedTo(bindAble);
        }