I'm currently creating a new UWApp in C# using Visual Studio 2017. after creating a new Class that will handle all the display of Xaml content.
I transferred a function containing this line of code:
...
Image imgObj = (Windows.UI.Xaml.Controls.Image)FindName("myTopImage");
...
to the new Class but FindName is highlighted in Red with this error message:
The name 'FindName' does not exist in the current context
I'm not sure why FindName is working well in the MainClass and not in the new Class. I've done this before in other App without any issues.
thanks for you time.
What I end up doing to solve the problem:
This way all the controls are out of the Main page and accessible from the new page class. I should have done this from the beginning.