In a previous Tip of the Day, I talked about using the content property of the Silverlight control (plug-in).
Previous documentation suggested that other XAML objects also have a content property, that is the content within the XAML element, as opposed to the content set specifically as a property.
That erroneous documentation differentiates setting the text in a textblock using the text property
<TextBlock
Name="TextBlock1"
Canvas.Left ="10"
Canvas.Top ="50"
FontSize="12"
FontWeight="Bold"
Width ="75"
Text="Text Property!"/>
from setting the text in the TextBlock as content <TextBlock Name="TextBlock2" Canvas.Left="150" Canvas.Top="50" FontSize="12" FontWeight="Bold"> Text Content! </TextBlock> </Canvas>
It turns out that the TextBlock does not have a content member. Whether set explicitly as a property or as the content of the XAML element, you retrieve the text from the TextBlock using the text property
handleLoad: function(plugIn, userContext, rootElement)
{
this.plugIn = plugIn;
var tb1 = this.plugIn.content.FindName("TextBlock1");
var tb2 = this.plugIn.content.FindName("TextBlock2");
alert("TextBlock1: " + tb1.Text);
alert("TextBlock2: " + tb2.Text);
}