6

I can't access a label defined in the xaml file from the code behind C# code.

I tried the x:name="l" property but it tells me that "'l' is not defined":

enter image description here

Could anyone help me how to access controls from C# code behind by providing an example?

Ola Ström
  • 4,136
  • 5
  • 22
  • 41
Yossef Nagy
  • 409
  • 1
  • 7
  • 12
  • 1
    what you're doing is correct, but the XF Intellisense is pretty flaky. Try restarting VS, and do a clean and build to see i that fixes it – Jason Jun 02 '18 at 01:04
  • @Jason Thanks unloading and reloading the project really did the trick put this solution for me to mark it as answer thanks again – Yossef Nagy Jun 02 '18 at 01:13

1 Answers1

8

what you're doing is correct, but the XF Intellisense is pretty flaky. Try restarting VS, and do a clean and build to see i that fixes it

Jason
  • 86,222
  • 15
  • 131
  • 146