async void OnContentPopupTest2Clicked(object sender, EventArgs e) { MyPopup popup = new MyPopup(); var defaultButton = new Button { Text = "Set BackgroundColor to Default (Transparent)", }; defaultButton.Clicked += (s, ee) => { popup.BackgroundColor = Color.Default; }; var grayButton = new Button { Text = "Set Background Color to Gray", }; grayButton.Clicked += (s, ee) => { popup.BackgroundColor = Color.Gray; }; var dismiss = new Button { Text = "Dismiss", }; dismiss.Clicked += (s, ee) => { popup?.Dismiss(); }; var label = new Label { Text = "This ContentPopup is dismissed as a below dismiss button.", HorizontalTextAlignment = TextAlignment.Center, }; var grid = new Grid(); grid.RowDefinitions.Add(new RowDefinition()); grid.RowDefinitions.Add(new RowDefinition()); grid.RowDefinitions.Add(new RowDefinition()); grid.RowDefinitions.Add(new RowDefinition()); grid.RowDefinitions.Add(new RowDefinition()); grid.Children.Add(label, 0, 1, 1, 2); grid.Children.Add(defaultButton, 0, 1, 2, 3); grid.Children.Add(grayButton, 0, 1, 3, 4); grid.Children.Add(dismiss, 0, 1, 4, 5); popup.Content = grid; await Navigation.ShowPopup(popup); }
async void OnContentPopupTest2Clicked(object sender, EventArgs e) { MyPopup popup = new MyPopup(); var dismiss = new Button { Text = "Dismiss", MinimumHeightRequest = 75, }; dismiss.Clicked += (s, ee) => { popup?.Dismiss(); }; var label = new Label { Text = "This ContentPopup is dismissed as a below dismiss button.", HorizontalTextAlignment = TextAlignment.Center, }; var grid = new Grid(); grid.HeightRequest = 1080; grid.WidthRequest = 1920; grid.RowDefinitions.Add(new RowDefinition()); grid.RowDefinitions.Add(new RowDefinition()); grid.RowDefinitions.Add(new RowDefinition()); grid.RowDefinitions.Add(new RowDefinition()); grid.RowDefinitions.Add(new RowDefinition()); grid.Children.Add(label, 0, 1, 1, 3); grid.Children.Add(dismiss, 0, 1, 3, 4); popup.Content = grid; await Navigation.ShowPopup(popup); }