/// <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); }
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 bindAble</param> protected override void OnDetachingFrom(SampleView bindAble) { this.datagrid = null; this.datapager = null; this.viewModel = null; base.OnDetachingFrom(bindAble); }
/// <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); }
/// <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.datagrid.QueryRowHeight += this.Datagrid_QueryRowHeight; this.datagrid.PropertyChanged += this.Datagrid_PropertyChanged; base.OnAttachedTo(bindAble); }
/// <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.datagrid.QueryRowHeight -= this.Datagrid_QueryRowHeight; this.datagrid.PropertyChanged -= this.Datagrid_PropertyChanged; base.OnDetachingFrom(bindAble); }
protected override void OnAttachedTo(SampleView bindable) { dataGrid = bindable.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); dataGrid.GridLongPressed += DataGrid_GridLongPressed; viewModel = bindable.FindByName <SortingViewModel>("viewModel"); popupLayout = bindable.FindByName <Syncfusion.XForms.PopupLayout.SfPopupLayout>("popUpLayout"); popupLayout.PopupView.AnimationMode = AnimationMode.Fade; popupLayout.PopupView.AnimationDuration = 100; popupLayout.PopupView.ShowCloseButton = false; popupLayout.PopupView.ShowFooter = false; popupLayout.PopupView.ShowHeader = false; popupLayout.PopupView.HeightRequest = 195; if (Device.Idiom == TargetIdiom.Phone) { popupLayout.PopupView.WidthRequest = 190; } else { popupLayout.PopupView.WidthRequest = 210; } popupLayout.PopupView.ContentTemplate = new DataTemplate(() => { return(PopupViewInitialization()); }); base.OnAttachedTo(bindable); }
protected override void OnDetachingFrom(SampleView bindable) { dataGrid.GridLoaded -= DataGrid_GridLoaded; dataGrid = null; relativeLayout = null; base.OnDetachingFrom(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 to subscribe to AssociatedObject events and initialize properties. /// </summary> /// <param name="bindAble">A sampleView type of parameter bindAble</param> protected override void OnAttachedTo(SampleView bindAble) { this.dataGrid = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); this.relativeLayout = bindAble.FindByName <RelativeLayout>("relative"); this.dataGrid.GridLoaded += this.DataGrid_GridLoaded; base.OnAttachedTo(bindAble); }
/// <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.GridLoaded -= this.DataGrid_GridLoaded; this.dataGrid = null; this.relativeLayout = 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 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); }
protected override void OnDetachingFrom(SampleView bindable) { datagrid = null; datapager = null; viewModel = 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 while View was detached from window /// </summary> /// <param name="bindAble">DataGrid type of bindAble parameter</param> protected override void OnDetachingFrom(SampleView bindAble) { this.dataGrid.AutoGeneratingColumn -= this.DataGrid_AutoGeneratingColumn; this.dataGrid = null; this.switch1.Toggled -= this.Switch1_Toggled; this.switch1 = 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); }
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) { base.OnAttachedTo(bindAble); this.popupLayout = bindAble.Content.FindByName <SfPopupLayout>("popupLayout"); this.datagrid = bindAble.Content.FindByName <SfDataGrid>("dataGrid"); this.datagrid.GridLoaded += this.Datagrid_GridLoaded; this.datagrid.AutoGeneratingColumn += this.Datagrid_AutoGeneratingColumn; }
/// <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); }
/// <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); }
protected override void OnDetachingFrom(SampleView bindable) { ResizingPicker.SelectedIndexChanged -= OnSelectionChanged; datagrid = null; myGrid = null; transparent = null; customView = null; ResizingPicker = 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.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 OnAttachedTo(SampleView bindable) { base.OnAttachedTo(bindable); popupLayout = bindable.Content.FindByName <Syncfusion.XForms.PopupLayout.SfPopupLayout>("popupLayout"); datagrid = bindable.Content.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); datagrid.GridLoaded += Datagrid_GridLoaded; viewModel = new SwipingViewModel(); bindable.BindingContext = viewModel; viewModel.SetRowstoGenerate(30); datagrid.ItemsSource = viewModel.OrdersInfo; datagrid.AutoGeneratingColumn += Datagrid_AutoGeneratingColumn; relativePage = bindable.FindByName <RelativeLayout>("relativeLayout"); relativePage.BackgroundColor = Color.FromRgba(0, 0, 0, 0.8); AddLayoutTapGeture(); resizingIllustration = (StackLayout)bindable.Resources["ResizingIllustration"]; resizingIllustrationImage = (Image)resizingIllustration.Children[0]; #if COMMONSB resizingIllustrationImage.Source = ImageSource.FromResource("SampleBrowser.Icons.ResizingIllustration.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); #else resizingIllustrationImage.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Icons.ResizingIllustration.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); #endif editIllustration = (Image)bindable.Resources["EditIllustration"]; #if COMMONSB editIllustration.Source = ImageSource.FromResource("SampleBrowser.Icons.EditIllustration.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); #else editIllustration.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Icons.EditIllustration.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); #endif swipeIllustration = (StackLayout)bindable.Resources["SwipeIllustration"]; swipeIllustrationImage = (Image)swipeIllustration.Children[0]; #if COMMONSB swipeIllustrationImage.Source = ImageSource.FromResource("SampleBrowser.Icons.SwipeIllustration.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); #else swipeIllustrationImage.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Icons.SwipeIllustration.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); #endif dragdropLayout = (RelativeLayout)bindable.Resources["dragDropLayout"]; handSymbol = dragdropLayout.Children[0] as Image; #if COMMONSB handSymbol.Source = ImageSource.FromResource("SampleBrowser.Icons.HandSymbol.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); dragAndDropIllustration = dragdropLayout.Children[1] as Image; dragAndDropIllustration.Source = ImageSource.FromResource("SampleBrowser.Icons.DragAndDropIllustration.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); #else handSymbol.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Icons.HandSymbol.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); dragAndDropIllustration = dragdropLayout.Children[1] as Image; dragAndDropIllustration.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Icons.DragAndDropIllustration.png", typeof(OnBoardHelpsBehavior).GetTypeInfo().Assembly); #endif nextlabel = bindable.FindByName <Label>("label"); oklabel = bindable.FindByName <Label>("oklabel"); oklabel.IsVisible = false; }
/// <summary> /// Initializes a new instance of the SelectionController class. /// </summary> /// <param name="datagrid">DataGrid type of Parameter</param> public SelectionController(Syncfusion.SfDataGrid.XForms.SfDataGrid datagrid) : base(datagrid) { this.DataGrid = datagrid; this.SelectionColors = new Color[] { Color.FromRgb(176, 58, 46), Color.FromRgb(108, 52, 131), Color.FromRgb(31, 97, 141), Color.FromRgb(17, 122, 101), Color.FromRgb(183, 140, 11) }; }
protected override void OnAttachedTo(Label bindable) { base.OnAttachedTo(bindable); datagrid = Parameter as Syncfusion.SfDataGrid.XForms.SfDataGrid; viewModel = datagrid.ItemsSource as ObservableCollection <OrderInfo>; datagrid.SwipeEnded += Datagrid_SwipeEnded; var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, e) => { viewModel.RemoveAt(swipedRowIndex - 1); }; (bindable as Label).GestureRecognizers.Add(tapGestureRecognizer); }
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); }
/// <summary> /// You can override this method to subscribe to AssociatedObject events and initialize properties. /// </summary> /// <param name="bindAble">DataGrid type of bindAble parameter</param> protected override void OnAttachedTo(SampleView bindAble) { this.dataGrid = bindAble.FindByName <SfDataGrid>("dataGrid"); if (Device.Idiom == TargetIdiom.Phone) { this.dataGrid.DefaultColumnWidth = 120; } else { this.dataGrid.DefaultColumnWidth = 160; } this.dataGrid.AutoGeneratingColumn += this.DataGrid_AutoGeneratingColumn; this.switch1 = bindAble.FindByName <Switch>("switch1"); this.switch1.Toggled += this.Switch1_Toggled; base.OnAttachedTo(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 parameter as bindAble</param> protected override void OnAttachedTo(SampleView bindAble) { this.customLayout = bindAble.FindByName <CustomLayout>("custumLayout"); this.dataGrid = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); this.rightImage = (Image)bindAble.Resources["rightImage"]; this.leftImage = (Image)bindAble.Resources["leftImage"]; this.viewModel = new SwipingViewModel(); bindAble.BindingContext = this.viewModel; this.dataGrid.ItemsSource = this.viewModel.OrdersInfo; bindAble.PropertyChanged += this.Swiping_PropertyChanged; this.formView = new FormsView(this.dataGrid); this.customLayout.Children.Add(this.formView); this.dataGrid.GridTapped += this.DataGrid_GridTapped; this.rightImage.BindingContextChanged += this.RightImage_BindingContextChanged; this.leftImage.BindingContextChanged += this.LeftImage_BindingContextChanged; this.dataGrid.SwipeEnded += this.DataGrid_SwipeEnded; base.OnAttachedTo(bindAble); }