"Controls name not showing up in the code behind" in Silverlight

Reason for “Controls name not showing up in the code behind” in Silverlight

 

This was a major research for me. They I found the reason. I added a control in the main folder of the application that I have created, then I moved that control to a sub folder, and I manually renamed the namespace form the XAML and XAML.CS and the issue occurred; I had a TextBox in the XAML (MyTextBox); I had to set the Text of MyTextBox from the code behind and I wasn’t able to do it as I was not getting the name of the object in the intellisense and When I tried naming it, it showed me the error that the control does not exist in the current context

 

Weird!

 

The reason for that was the UserControl was dragged to another folder and since there is a change in the reference, it was not picking up the controls in the XAML;

 

I had to recreate the control in the sub folder to solve this.

Comments

  1. Thank you Neal, this saved my day: I though I was going mad...
    Paul

    ReplyDelete

Post a Comment