/// <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); }
/// <summary> /// Initializes the required properties of the data pager. /// </summary> /// <param name="bindAble">The sample view that hosts the data grid and the data pager.</param> private void InitPager(SampleView bindAble) { this.datagrid = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); this.datapager = bindAble.FindByName <SfDataPager>("dataPager"); this.selectionPicker = bindAble.FindByName <PickerExt>("SelectionPicker"); if (this.selectionPicker != null) { this.selectionPicker.Items.Add("Rectangle"); this.selectionPicker.Items.Add("Circle"); this.selectionPicker.SelectedIndexChanged += this.SelectionPicker_SelectedIndexChanged; this.datapager.AppearanceManager = new PagerAppearance(); } else { this.datapager.PropertyChanged += this.DatapagerPropertyChanged; } this.datapager.PageSize = 20; this.datapager.Source = this.viewModel.OrdersInfo; this.datagrid.ItemsSource = this.datapager.PagedSource; (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; } }
/// <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.OnSelectionChanged; this.dataGrid = null; this.selectionPicker = null; base.OnDetachingFrom(bindAble); }
protected override void OnDetachingFrom(SampleView bindable) { selectionPicker.SelectedIndexChanged -= OnSelectionChanged; dataGrid = null; selectionPicker = null; base.OnDetachingFrom(bindable); }
/// <summary> /// You can override this method while View was detached from window /// </summary> /// <param name="bindAble">A sampleView type of parameter bindAble</param> protected override void OnDetachingFrom(SampleView bindAble) { this.dataGrid.GridViewCreated -= this.GridViewCreated; this.stylePicker.SelectedIndexChanged -= this.OnStyleChanged; this.dataGrid = null; this.stylePicker = null; base.OnDetachingFrom(bindAble); }
protected override void OnDetachingFrom(SampleView bindable) { dataGrid.GridViewCreated -= GridViewCreated; stylePicker.SelectedIndexChanged -= OnStyleChanged; dataGrid = null; stylePicker = 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 parameter bindAble</param> protected async override void OnAttachedTo(SampleView bindAble) { var assembly = Assembly.GetAssembly(this.GetType()); await Task.Delay(200); this.customView = bindAble.FindByName <Grid>("customLayout"); this.transparent = bindAble.FindByName <Grid>("transparent"); this.datagrid = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); this.resizingPicker = bindAble.FindByName <PickerExt>("ResizingPicker"); if (Device.RuntimePlatform == Device.UWP && Device.Idiom == TargetIdiom.Desktop) { this.datagrid.Columns.ForEach(column => column.MaximumWidth = 500); } if (Device.RuntimePlatform != Device.UWP) { this.datagrid.ResizingMode = ResizingMode.OnMoved; this.resizingPicker.SelectedIndex = 0; } else { this.datagrid.ResizingMode = ResizingMode.OnTouchUp; this.resizingPicker.SelectedIndex = 1; } this.resizingPicker.SelectedIndexChanged += this.OnSelectionChanged; this.datagrid.GridStyle = new DefaultStyle(); this.myGrid = new Grid(); this.myGrid.VerticalOptions = LayoutOptions.FillAndExpand; this.myGrid.HorizontalOptions = LayoutOptions.FillAndExpand; this.myGrid.RowDefinitions = new RowDefinitionCollection { new RowDefinition { Height = new GridLength(0.6, GridUnitType.Star) }, new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, }; this.myGrid.Children.Add( new Image() { Opacity = 1.0, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Source = "ResizingIllustration.png", }, 0, 0); this.myGrid.BackgroundColor = Color.Transparent; this.myGrid.GestureRecognizers.Add(new TapGestureRecognizer() { Command = new Command(this.Collapse) }); this.customView.Children.Add(this.myGrid); base.OnAttachedTo(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 while View was detached from window /// </summary> /// <param name="bindAble">SampleView type of bindAble parameter</param> protected override void OnDetachingFrom(SampleView bindAble) { this.resizingPicker.SelectedIndexChanged -= this.OnSelectionChanged; this.datagrid = null; this.myGrid = null; this.transparent = null; this.customView = null; this.resizingPicker = null; base.OnDetachingFrom(bindAble); }
protected override void OnDetachingFrom(SampleView bindable) { ResizingPicker.SelectedIndexChanged -= OnSelectionChanged; datagrid = null; myGrid = null; transparent = null; customView = null; ResizingPicker = null; base.OnDetachingFrom(bindable); }
protected override void OnDetachingFrom(SampleView bindable) { optionsList.SelectedIndexChanged -= OnFilterOptionsChanged; columnsList.SelectedIndexChanged -= OnColumnsSelectionChanged; filterText.TextChanged -= OnFilterTextChanged; dataGrid = null; optionsList = null; columnsList = null; filterText = null; base.OnDetachingFrom(bindable); }
/// <summary> /// You can override this method while View was detached from window /// </summary> /// <param name="bindAble">SampleView type of bindAble parameter</param> protected override void OnDetachingFrom(SampleView bindAble) { this.optionsList.SelectedIndexChanged -= this.OnFilterOptionsChanged; this.columnsList.SelectedIndexChanged -= this.OnColumnsSelectionChanged; this.filterText.TextChanged -= this.OnFilterTextChanged; this.dataGrid = null; this.optionsList = null; this.columnsList = null; this.filterText = null; base.OnDetachingFrom(bindAble); }
/// <summary> /// You can override this method to subscribe to Associated Object events and initialize properties. /// </summary> /// <param name="bindAble">A sample View type of parameter bindAble</param> protected override void OnAttachedTo(SampleView bindAble) { this.dataGrid = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); this.viewModel = new StylesViewModel(); bindAble.BindingContext = this.viewModel; this.dataGrid.ItemsSource = this.viewModel.OrdersInfo; this.dataGrid.GridViewCreated += this.GridViewCreated; this.stylePicker = bindAble.FindByName <PickerExt>("StylePicker"); this.stylePicker.Items.Add("Dark"); this.stylePicker.Items.Add("Blue"); this.stylePicker.Items.Add("Red"); this.stylePicker.Items.Add("Green"); this.stylePicker.Items.Add("Purple"); this.stylePicker.SelectedIndex = 1; this.stylePicker.SelectedIndexChanged += this.OnStyleChanged; base.OnAttachedTo(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.viewModel = new SelectionViewModel(); bindAble.BindingContext = this.viewModel; this.selectionPicker = bindAble.FindByName <PickerExt>("SelectionPicker"); this.selectionPicker.Items.Add("None"); this.selectionPicker.Items.Add("Single"); this.selectionPicker.Items.Add("Single Deselect"); this.selectionPicker.Items.Add("Multiple"); this.dataGrid = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); this.dataGrid.ItemsSource = this.viewModel.OrdersInfo; this.dataGrid.AllowKeyboardNavigation = true; this.dataGrid.SelectionController = new SelectionController(this.dataGrid); this.selectionPicker.SelectedIndexChanged += this.OnSelectionChanged; this.dataGrid.SelectedItems.Add(this.viewModel.OrdersInfo[1]); this.dataGrid.SelectedItems.Add(this.viewModel.OrdersInfo[3]); this.dataGrid.SelectedItems.Add(this.viewModel.OrdersInfo[7]); base.OnAttachedTo(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); }
protected override void OnAttachedTo(SampleView bindable) { viewModel = new FilteringViewModel(); dataGrid = bindable.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); bindable.BindingContext = viewModel; optionsList = bindable.FindByName <PickerExt>("OptionsList"); columnsList = bindable.FindByName <PickerExt>("ColumnsList"); filterText = bindable.FindByName <SearchBarExt>("filterText"); optionsList.Items.Add("Equals"); optionsList.Items.Add("NotEquals"); optionsList.Items.Add("Contains"); columnsList.Items.Add("All Columns"); columnsList.Items.Add("CustomerID"); columnsList.Items.Add("BookID"); columnsList.Items.Add("FirstName"); columnsList.Items.Add("LastName"); columnsList.Items.Add("BookName"); columnsList.SelectedIndex = 0; viewModel.filtertextchanged = OnFilterChanged; filterText.TextChanged += OnFilterTextChanged; columnsList.SelectedIndexChanged += OnColumnsSelectionChanged; optionsList.SelectedIndexChanged += OnFilterOptionsChanged; base.OnAttachedTo(bindable); }