during my user control Loaded event I need to wire up some event handling and set some properties.
all of my controls are null? How do I reference my controls that are housed within the content panes?
No , your solution is good. the screen I'm looking at did not follow a good MVVM model (it was developed early on before thta pattern was fully embraced)
the correct thing to do is move most of that code out of the code behind and put it into the view model.
thanks again, your solution will do the trick.
Hello,
The best approach I could thing of for achieving your goal is implemented in the sample application that I attached in my previous reply. If you prefer to access the elements in the visual tree of your Silverlight application by their Name property, you can refer to this link: http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.name%28v=VS.100%29.aspx . Here is shown how you can use this property to access the elements in your appliction.
If you require any further clarifications please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I was expecting to be able to reference my controls by "this.Grid"
apparently I have to walk the gamut down by parent child.
thanks
I have tested your scenario and it seems to work as it supposed to.I have created a sample application in which I handle the Loaded event for the user control and changet the foregroung of a TextBlock which is in a ContentPane and also I am addin a hadler for the Click event of a Button which also is in same ContentPane.
Please let me know if you can reproduce the issue that you are having with my sample appcication or I have missed something form it.
Looking forward to hearing from you.