I can't access any nodes in the Silverlight Object Model using the recommended functions. the xaml file I'm using for my silverlight control is:
<Canvas xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Line x:Name="myLine"
X1="10" Y1="10"
X2="50" Y2="50"
Stroke="Black"
StrokeThickness="4" />
</Canvas>
and I've created the Silverlight control using Silverlight.CreateObjet(...) but if I try:
var oSilverlightControl = document.getElementById(sSilverlightControlId);
var foundControl = oSilverlightControl.content.FindName("myLine");
to get a reference to the Line object it simply returns null, although oSilverlightControl was found with no problem in the DOM. Also if I try
var foundRoot = oSilverlightControl.content.Root;
it also returns null.
What am I missing here??? I can't seem to access a single Silverlight object using javascript, and all the documentation I've found is no help, since as far as I can tell they do the same thing I'm doing.