Seems to be a VS bug whereby in some instances adding or renaming an object in the xaml file causes “Does Not Exist in Current Context Error” when using the object in the .xaml.cs file. Looking online it seems to be something that plagues lots of devs…
Compiles OK but Intellisense red lining the object name in .xaml.cs file – Fix
Ensure you are in Debug mode – have found that changing from Release to debug mode, cleaning and then rebuilding can cure the issue. If not, stay in debug mode, then:
- Clean your project
- Manually delete bin and obj folders (in all folders if your project has more than one project type)
- Restart VS
- Rebuild your project (you may need to do for all project types if you have more than one project type)
Won’t compile – Possible fix
Add ;assembly= at the end of your xmlns:local, like this:
xmlns:local="using:my_namespace_name;assembly="
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.