Exemple #1
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            viewModel = new PullToRefreshViewModel();
            bindable.BindingContext = viewModel;
            pullToRefresh           = bindable.FindByName <Syncfusion.SfPullToRefresh.XForms.SfPullToRefresh>("pullToRefresh");
            SubGrid1       = bindable.FindByName <Grid>("SubGrid1");
            SubGrid2       = bindable.FindByName <Grid>("SubGrid2");
            listView       = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            transitionType = bindable.FindByName <PickerExt>("transitionType");
            label2         = bindable.FindByName <Label>("label2");
            label3         = bindable.FindByName <Label>("label3");
            imagedata      = bindable.FindByName <Image>("imagedata");

            SubGrid1.BindingContext        = viewModel.Data;
            pullToRefresh.PullingThreshold = 100;
            listView.ItemsSource           = viewModel.SelectedData;
            if (Device.RuntimePlatform == Device.iOS)
            {
                pullToRefresh.SizeChanged += Pull_SizeChanged;
            }
            pullToRefresh.Refreshing   += PullToRefresh_Refreshing;
            pullToRefresh.Refreshed    += PullToRefresh_Refreshed;
            listView.SelectionChanging += ListView_SelectionChanging;
            transitionType.Items.Add("Push");
            transitionType.Items.Add("SlideOnTop");
            transitionType.SelectedIndex         = 1;
            transitionType.SelectedIndexChanged += OnSelectionChanged;
            base.OnAttachedTo(bindable);
        }
 protected override void OnDetachingFrom(BindableObject bindable)
 {
     transitionType.SelectedIndexChanged -= OnSelectionChanged;
     pullToRefresh.Refreshing            -= PullToRefresh_Refreshing;
     pullToRefresh = null;
     datagrid      = null;
     viewModel     = 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);
 }
        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);
        }
Exemple #5
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            ListView = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            pulltoRefreshViewModel            = new ListViewPullToRefreshViewModel();
            pulltoRefreshViewModel.Navigation = bindable.Navigation;
            ListView.BindingContext           = pulltoRefreshViewModel;
            ListView.ItemsSource = pulltoRefreshViewModel.BlogsInfo;

            pullToRefresh             = bindable.FindByName <Syncfusion.SfPullToRefresh.XForms.SfPullToRefresh>("pullToRefresh");
            pullToRefresh.Refreshing += PullToRefresh_Refreshing;

            picker = bindable.FindByName <PickerExt>("transitionTypePicker");
            picker.Items.Add("SlideOnTop");
            picker.Items.Add("Push");
            picker.SelectedIndex         = 1;
            picker.SelectedIndexChanged += Picker_SelectedIndexChanged;
            base.OnAttachedTo(bindable);
        }
Exemple #6
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);
 }
        protected override void OnAttachedTo(SampleView bindable)
        {
            viewModel = new GettingStartedViewModel();
            bindable.BindingContext = viewModel;
            pullToRefresh           = bindable.FindByName <Syncfusion.SfPullToRefresh.XForms.SfPullToRefresh>("pullToRefresh");
            datagrid             = bindable.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid");
            datagrid.ItemsSource = viewModel.OrdersInfo;
            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;

            if (Device.RuntimePlatform == Device.UWP)
            {
                pullToRefresh.ProgressBackgroundColor = Color.FromHex("0065ff");
                pullToRefresh.ProgressStrokeColor     = Color.FromHex("#ffffff");
            }

            base.OnAttachedTo(bindable);
        }