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) { infoNotification = null; editIllustration = null; resizingIllustrationImage = null; popupLayout = null; relativePage = 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; }
protected override void OnDetachingFrom(SampleView bindable) { animatePicker.SelectedIndexChanged -= AnimationPicker_SelectedIndexChanged; buttonlayoutPicker.SelectedIndexChanged -= ButtonlayoutPicker_SelectedIndexChanged; relativePosition.Clicked -= RelativePosition_Clicked; animatePicker = null; buttonlayoutPicker = null; translationPicker = null; popupLayout = null; relativePosition = null; base.OnDetachingFrom(bindable); }
private async void AcceptButton_Clicked(object sender, EventArgs e) { if (PopupObject != null) { (PopupObject as Syncfusion.XForms.PopupLayout.SfPopupLayout).PopupView.AnimationMode = AnimationMode.None; (PopupObject as Syncfusion.XForms.PopupLayout.SfPopupLayout).Dismiss(); } Syncfusion.XForms.PopupLayout.SfPopupLayout popup = (new SeatSelectionPage()).Content as Syncfusion.XForms.PopupLayout.SfPopupLayout; popup.PopupView.AnimationMode = AnimationMode.None; await Task.Delay(200); popup.Show(); }
protected override void OnAttachedTo(SampleView bindable) { base.OnAttachedTo(bindable); popupLayout = bindable.Content.FindByName <Syncfusion.XForms.PopupLayout.SfPopupLayout>("popupLayout"); SetDefaultValues(); animatePicker = bindable.FindByName <Picker>("AnimationTypePicker"); buttonlayoutPicker = bindable.FindByName <Picker>("ButtonlayoutTypePicker"); translationPicker = bindable.FindByName <Picker>("RelativePositionPicker"); relativePosition = bindable.FindByName <Button>("RelativeButton"); showPopupCenter = bindable.FindByName <Button>("centerPositionButton"); MainLayout = bindable.FindByName <Grid>("mainLayout"); animatePicker.SelectedIndexChanged += AnimationPicker_SelectedIndexChanged; buttonlayoutPicker.SelectedIndexChanged += ButtonlayoutPicker_SelectedIndexChanged; relativePosition.Clicked += RelativePosition_Clicked; showPopupCenter.Clicked += ShowPopupCenter_Clicked; buttonlayoutPicker.SelectedIndex = 0; animatePicker.SelectedIndex = 5; translationPicker.SelectedIndex = 8; LoadPopup(); }
/// <summary> /// You can override this method to subscribe to AssociatedObject events and initialize properties. /// </summary> /// <param name="bindAble">SampleView type of bindAble</param> protected async override void OnAttachedTo(SampleView bindAble) { this.dataGrid = bindAble.FindByName <Syncfusion.SfDataGrid.XForms.SfDataGrid>("dataGrid"); this.dataGrid.GridLongPressed += this.DataGrid_GridLongPressed; this.viewModel = bindAble.FindByName <SortingViewModel>("viewModel"); this.popupLayout = bindAble.FindByName <Syncfusion.XForms.PopupLayout.SfPopupLayout>("popUpLayout"); this.popupLayout.PopupView.AnimationMode = AnimationMode.Fade; this.popupLayout.PopupView.AnimationDuration = 100; this.popupLayout.PopupView.ShowCloseButton = false; this.popupLayout.PopupView.ShowFooter = false; this.popupLayout.PopupView.ShowHeader = false; this.popupLayout.PopupView.HeightRequest = 195; if (Device.Idiom == TargetIdiom.Phone) { this.popupLayout.PopupView.WidthRequest = 190; } else { this.popupLayout.PopupView.WidthRequest = 210; } this.popupLayout.PopupView.ContentTemplate = new DataTemplate(() => { return(PopupViewInitialization()); }); var assembly = Assembly.GetAssembly(Application.Current.GetType()); await Task.Delay(200); this.customView = bindAble.FindByName <Grid>("customLayout"); this.transparent = bindAble.FindByName <Grid>("transparent"); this.myGrid = new Grid(); this.myGrid.VerticalOptions = LayoutOptions.FillAndExpand; this.myGrid.HorizontalOptions = LayoutOptions.FillAndExpand; this.myGrid.RowDefinitions = new RowDefinitionCollection { new RowDefinition { Height = new GridLength(1.1, GridUnitType.Star) }, new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }, }; this.myGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }); this.myGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1.8, GridUnitType.Star) }); this.myGrid.Children.Add( new Image() { Opacity = 1.0, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Source = "ContextMenuIllustration.png" }, 1, 1); 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 OnAttachedTo(SampleView bindable) { if (initialPopup == null) { initialPopup = new DetailsViewInitialPopup().Content as Syncfusion.XForms.PopupLayout.SfPopupLayout; initialPopup.Show(); } popupLayout = bindable.FindByName <Syncfusion.XForms.PopupLayout.SfPopupLayout>("popUp"); listview = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView"); listview.ItemsSource = viewModel.contactsinfo; listview.ItemTapped += ListView_ItemTapped; listview.Loaded += Listview_Loaded; popupLayout.PopupView.AnimationMode = AnimationMode.None; popupLayout.PopupView.ShowHeader = false; popupLayout.PopupView.ShowFooter = false; popupLayout.PopupView.HeightRequest = 150; if (Device.RuntimePlatform == Device.iOS) { popupLayout.PopupView.PopupStyle.BorderColor = Color.White; } popupLayout.PopupView.ContentTemplate = new DataTemplate(() => { Grid popupcontent = new Grid(); popupcontent.BackgroundColor = Color.White; popupcontent.HorizontalOptions = LayoutOptions.FillAndExpand; popupcontent.VerticalOptions = LayoutOptions.FillAndExpand; popupcontent.RowDefinitions.Add(new RowDefinition { Height = 40 }); popupcontent.RowDefinitions.Add(new RowDefinition { Height = 40 }); popupcontent.RowDefinitions.Add(new RowDefinition { Height = 40 }); popupcontent.ColumnDefinitions.Add(new ColumnDefinition { Width = 50 }); popupcontent.ColumnDefinitions.Add(new ColumnDefinition { Width = 500 }); sendMessageText = new Label(); sendMessageText.Text = "Send a Message"; sendMessageText.TextColor = Color.FromHex("#000000"); sendMessageText.FontSize = 16; sendMessageText.HorizontalOptions = LayoutOptions.Start; sendMessageText.VerticalOptions = LayoutOptions.Center; sendMessageText.Opacity = 87; sendMessageImage = new Image(); sendMessageImage.Opacity = 0.5f; #if COMMONSB sendMessageImage.Source = ImageSource.FromResource("SampleBrowser.Images.SendMessage.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly); #else sendMessageImage.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Images.SendMessage.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly); #endif sendMessageImage.WidthRequest = 20; sendMessageImage.HeightRequest = 20; sendMessageImage.HorizontalOptions = LayoutOptions.CenterAndExpand; sendMessageImage.VerticalOptions = LayoutOptions.CenterAndExpand; blockSpanText = new Label(); blockSpanText.Text = "Block / Report Spam"; blockSpanText.TextColor = Color.FromHex("#000000"); blockSpanText.FontSize = 16; blockSpanText.HorizontalOptions = LayoutOptions.Start; blockSpanText.VerticalOptions = LayoutOptions.Center; blockSpanText.Opacity = 87; blockSpanImage = new Image(); blockSpanImage.Opacity = 0.5f; #if COMMONSB blockSpanImage.Source = ImageSource.FromResource("SampleBrowser.Images.BlockSpan.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly); #else blockSpanImage.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Images.BlockSpan.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly); #endif blockSpanImage.HeightRequest = 20; blockSpanImage.WidthRequest = 20; blockSpanImage.HorizontalOptions = LayoutOptions.CenterAndExpand; blockSpanImage.VerticalOptions = LayoutOptions.CenterAndExpand; callDetailText = new Label(); callDetailText.Text = "Send a Message"; callDetailText.TextColor = Color.FromHex("#000000"); callDetailText.FontSize = 16; callDetailText.HorizontalOptions = LayoutOptions.Start; callDetailText.VerticalOptions = LayoutOptions.Center; callDetailText.Opacity = 87; callDetailImage = new Image(); callDetailImage.Opacity = 0.5f; #if COMMONSB callDetailImage.Source = ImageSource.FromResource("SampleBrowser.Images.CallDetails.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly); #else callDetailImage.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Images.CallDetails.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly); #endif callDetailImage.HeightRequest = 20; callDetailImage.WidthRequest = 20; callDetailImage.HorizontalOptions = LayoutOptions.CenterAndExpand; callDetailImage.VerticalOptions = LayoutOptions.CenterAndExpand; if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.UWP) { popupcontent.Padding = 10; sendMessageText.Margin = new Thickness(0, 10, 0, 0); sendMessageText.WidthRequest = 500; sendMessageText.HeightRequest = 40; sendMessageImage.WidthRequest = 20; sendMessageImage.HeightRequest = 20; blockSpanText.Margin = new Thickness(0, 10, 0, 0); blockSpanText.WidthRequest = 500; blockSpanText.HeightRequest = 40; blockSpanImage.WidthRequest = 20; blockSpanImage.HeightRequest = 20; callDetailText.Margin = new Thickness(0, 10, 0, 0); callDetailText.WidthRequest = 500; callDetailText.HeightRequest = 40; callDetailImage.WidthRequest = 20; callDetailImage.HeightRequest = 20; } popupcontent.Children.Add(sendMessageImage, 0, 0); popupcontent.Children.Add(sendMessageText, 1, 0); popupcontent.Children.Add(blockSpanImage, 0, 1); popupcontent.Children.Add(blockSpanText, 1, 1); popupcontent.Children.Add(callDetailImage, 0, 2); popupcontent.Children.Add(callDetailText, 1, 2); return(popupcontent); }); }