Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How to access a control in a page programmatically?

$
0
0

I have a ContentPage as follows:

    this.Content = new TableView
                {
                    Intent = TableIntent.Form,
                    Root = new TableRoot (form.Name) {

                    }
                };

Then I add TableSections with a loop in Root. Each TableSection contains ViewCells with different controls. Now on some button click I wan't to access a control (let's say by unique ClassId) from this content page. How is it possible? I am expecting something like:

aButton.Clicked += (sender, e) =>
            {
                var requiredViewIWantToGrab=aButton.Parent.Parent.Root.children[10].children[0].View;
}

Viewing all articles
Browse latest Browse all 58056

Trending Articles