Can't access objects from code behind

Hey there,
I am very new to Xamarin.Forms and had some of my projects the same issue which I couldn't solve. I can't access my in xaml defined objects in the code behind, it just says that the "name does not exist in the current context". I texted several things for solving this problem, but no way I've found in the internet worked. I can still build the app, but when I get to this special function I get an unhandled exception.
As you can see in the pictures I have some other errors too, but the function where I get the error still works.
Thanks for your help and if you need more information just ask...

Greetings
Martin Muenster

Best Answer

Answers

  • Thank you very much, now my code is without errors! The Grid is just a temporary solution until I get to this.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    I can't access my in xaml defined objects in the code behind

    The bigger question is : Why are you trying to?
    I've built entire enterprise-grade apps without having to reach into the UI elements from code behind. If you're following good MVVM design you shouldn't be running into a need to do this so early in your learning.of Xamarin.

Sign In or Register to comment.