FindByName Returns Null When ContentPage Is Wrapped In TabbedPage

Very new to Xamarin, thanks in advance for being patient with me.

I have a ContentPage that contains a picker and a StackLayout of various data. I use the picker to change the data being displayed in the StackLayout, so I use FindByName to get its selected index in the codebehind. This works just find when I load the ContentPage by itself.

However, I want the ContentPage to be a tab in a TabbedPage. The app still compiles and runs when I add the ContentPage as a child in the TabbedPage and load the TabbedPage. However, FindByName returns null if I change the picker index and subsequently crashes the app.

Once again, this only occurs when the ContentPage is wrapped in the TabbedPage. It runs fine otherwise.

Any help is much appreciated!

Sign In or Register to comment.