Beispiel #1
0
        /// <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 type parameter named as bindAble</param>
 protected override void OnDetachingFrom(SampleView bindAble)
 {
     this.transitionType.SelectedIndexChanged -= this.OnSelectionChanged;
     this.pullToRefresh.Refreshing            -= this.PullToRefresh_Refreshing;
     this.pullToRefresh  = null;
     this.dataGrid       = null;
     this.transitionType = null;
     base.OnDetachingFrom(bindAble);
 }
 protected override void OnDetachingFrom(SampleView bindable)
 {
     transitionType.SelectedIndexChanged -= OnSelectionChanged;
     pullToRefresh.Refreshing            -= PullToRefresh_Refreshing;
     pullToRefresh  = null;
     dataGrid       = null;
     transitionType = null;
     base.OnDetachingFrom(bindable);
 }
 /// <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);
 }
        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);
        }
Beispiel #6
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);
        }
Beispiel #7
0
        /// <summary>
        /// You can override this method to subscribe to AssociatedObject events and initialize properties.
        /// </summary>
        /// <param name="bindAble">SampleView type of parameter named as bindAble</param>
        protected override void OnAttachedTo(SampleView bindAble)
        {
            this.listView = bindAble.FindByName <SfListView>("listView");
            this.pulltoRefreshViewModel            = new ListViewPullToRefreshViewModel();
            this.pulltoRefreshViewModel.Navigation = bindAble.Navigation;
            this.listView.BindingContext           = this.pulltoRefreshViewModel;
            this.listView.ItemsSource = this.pulltoRefreshViewModel.BlogsInfo;

            this.pullToRefresh             = bindAble.FindByName <SfPullToRefresh>("pullToRefresh");
            this.pullToRefresh.Refreshing += this.PullToRefresh_Refreshing;

            this.picker = bindAble.FindByName <PickerExt>("transitionTypePicker");
            this.picker.Items.Add("SlideOnTop");
            this.picker.Items.Add("Push");
            this.picker.SelectedIndex         = 1;
            this.picker.SelectedIndexChanged += this.Picker_SelectedIndexChanged;
            base.OnAttachedTo(bindAble);
        }
Beispiel #8
0
 /// <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);
 }
Beispiel #9
0
 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);
 }