How do I put a functioning button in a StackLayout?

The StackLayout is inside of a ScrollView. I want the button to open a URL. I also want other buttons to open local images. I'm not sure where to put the button.Clicked function and I cannot figure out how to declare different Button type variables within a StackLayout.

                    new StackLayout
                    {
                        Padding = 0,
                        Orientation = StackOrientation.Horizontal,
                        Children =
                        {
                            new Label
                            {
                                Text = "• ",
                                TextColor = Color.Black,
                            },
                            new Label
                            {
                                FontSize = 16,
                                Text = "Follow Surviving Sepsis Guidelines: ",
                                TextColor = Color.Black,
                                HorizontalOptions = LayoutOptions.Start
                            },

                           new Button
                            {
                                Text = "Click Me!",
                            },
                        }
                    },

https://developer.xamarin.com/api/type/Xamarin.Forms.Button/

https://developer.xamarin.com/api/type/Xamarin.Forms.StackLayout/

Best Answer

Answers

Sign In or Register to comment.