private void ListView_ItemTapped(object sender, Syncfusion.ListView.XForms.ItemTappedEventArgs e) { var itemIndex = viewModel.contactsinfo.IndexOf(e.ItemData as ContactInfo); var visibleLine = container.ScrollRows.GetVisibleLineAtLineIndex(itemIndex); double point = listview.Y + visibleLine.ClippedOrigin + visibleLine.Size; popupLayout.PopupView.PopupStyle.BorderThickness = 1; if (point + 140 <= listview.Height + 25) { popupLayout.Show(listview.X, listview.Y + visibleLine.ClippedOrigin + visibleLine.ClippedSize + GetRelativeYPoint("top")); } else { popupLayout.Show(listview.X, point - GetRelativeYPoint("bottom")); } }
private async void LoadPopup() { await Task.Delay(200); if (popupLayout.Content.Width <= 0) { return; } if (Device.Idiom != TargetIdiom.Phone) { popupLayout.PopupView.PopupStyle.BorderThickness = 1; popupLayout.PopupView.WidthRequest = 300; } else { popupLayout.PopupView.WidthRequest = popupLayout.Content.Width - 80; } popupLayout.Show(); }
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(); }
private void Datagrid_GridLoaded(object sender, GridLoadedEventArgs e) { popupLayout.PopupView.AnimationMode = AnimationMode.None; popupLayout.PopupView.HeightRequest = 200; popupLayout.PopupView.WidthRequest = 400; viewModel.PopupContentTemplate = new DataTemplate(() => { return(resizingIllustration); }); if (Device.RuntimePlatform == Device.UWP) { popupLayout.Show(datagrid.Columns[0].ActualWidth + datagrid.Columns[1].ActualWidth - 200, 0); } else if (Device.RuntimePlatform == Device.iOS) { popupLayout.Show(datagrid.Columns[0].ActualWidth, 80); } else { popupLayout.Show(datagrid.Columns[0].ActualWidth + datagrid.Columns[1].ActualWidth, 40); } AnimateResizingIllustrationImage(); tappingCount++; }
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); }); }
private void AddLayoutTapGeture() { var relativePage_Gesture = new TapGestureRecognizer(); relativePage.GestureRecognizers.Add(relativePage_Gesture); relativePage_Gesture.Tapped += (object sender, EventArgs e) => { if (tappingCount == 0 && popupLayout.IsOpen) { popupLayout.Dismiss(); popupLayout.PopupView.HeightRequest = 200; popupLayout.PopupView.WidthRequest = 400; viewModel.PopupContentTemplate = new DataTemplate(() => { return(resizingIllustration); }); if (Device.RuntimePlatform == Device.UWP) { popupLayout.Show(datagrid.Columns[0].ActualWidth + datagrid.Columns[1].ActualWidth - 200, 0); } else if (Device.RuntimePlatform == Device.iOS) { popupLayout.Show(datagrid.Columns[0].ActualWidth, 80); } else { popupLayout.Show(datagrid.Columns[0].ActualWidth + datagrid.Columns[1].ActualWidth, 40); } AnimateResizingIllustrationImage(); tappingCount++; } else if (tappingCount == 1 && popupLayout.IsOpen) { resizingIllustrationImage.IsVisible = false; popupLayout.IsOpen = false; popupLayout.PopupView.HeightRequest = 140; popupLayout.PopupView.WidthRequest = 140; viewModel.PopupContentTemplate = new DataTemplate(() => { return(editIllustration); }); popupLayout.Show((double)100, (double)200); oklabel.IsVisible = false; editIllustration.IsVisible = true; AnimateEditIllustrationImage(); tappingCount++; } else if (tappingCount == 2 && popupLayout.IsOpen) { popupLayout.IsOpen = false; popupLayout.PopupView.HeightRequest = 200; popupLayout.PopupView.WidthRequest = 400; viewModel.PopupContentTemplate = new DataTemplate(() => { return(swipeIllustration); }); popupLayout.Show((double)0, (double)200); editIllustration.IsVisible = false; oklabel.IsVisible = false; swipeIllustrationImage.IsVisible = true; AnimateSwipeIllustration(); tappingCount++; } else if (tappingCount == 3 && popupLayout.IsOpen) { popupLayout.IsOpen = false; popupLayout.PopupView.HeightRequest = 200; popupLayout.PopupView.WidthRequest = 200; viewModel.PopupContentTemplate = new DataTemplate(() => { return(dragdropLayout); }); popupLayout.Show((double)0, (double)200); swipeIllustrationImage.IsVisible = false; nextlabel.IsVisible = false; handSymbol.IsVisible = true; dragAndDropIllustration.IsVisible = true; oklabel.IsVisible = true; AnimateDragAndDropIllustration(); tappingCount++; } else { if (popupLayout.IsOpen) { handSymbol.IsVisible = false; dragAndDropIllustration.IsVisible = false; popupLayout.IsOpen = false; } else { nextlabel.IsVisible = false; oklabel.IsVisible = false; } relativePage.IsVisible = false; } }; }