Forum Xamarin.Forms

How can I change the text of an Label in a Frame with an Event?

axbeitaxbeit Member ✭✭

Hi there. Example Code:

        Frame f = new Frame
        {
            Content = new StackLayout
            {
                Children =
                {
                    new StackLayout
                    {
                        Children =
                        {
                            new Label
                            {
                                Text = "Test"
                            }
                        }
                    }
                }
            }
        };
        ranList.Children.Add(f);
        TapGestureRecognizer tapGesture = new TapGestureRecognizer();
        tapGesture.Tapped += OnTestTapped;
        f.GestureRecognizers.Add(tapGesture);

//...

    void OnTestTapped(object sender, EventArgs args)
    {
        Frame clicked = (Frame)sender;
    }

How could I change Text "Test" into something else with "OnTestTapped"?

Best Answers

Answers

Sign In or Register to comment.