Odd, from searching it seems SL2 beta doesn't support (yet?) WrapWithOverflow text wrapping. I've been only working with SL1 so I didn't run into that error. Sorry about that.
At any rate, here's my (relevant) xaml:
<Image MouseEnter="imgIn" MouseLeave="imgOut" DownloadProgressChanged="imgProgChanged" Opacity="1" x:Name="img1" Canvas.Left="50" Canvas.Top="25" Source="http://www.pollmenow.com/assets/pimgs/39454354860.jpg" />
Here's the javascript handler:
function imgProgChanged(sender, args)
{
if(sender.DownloadProgress == 1)
alert("DownloadProgress was 1 and img height was " + sender.Height); // reports 0 Height on first view. Hitting F5 to refresh always reports height correctly
}
Here is the workaround that always works correctly but results in an odd delay from when the content is first shown until it's positioned correctly. It seems that even a 100ms delay gets the property set:
var img = null;
function imgProgChanged(sender, args)
{
if(sender.DownloadProgress == 1)
{
img = sender;
setTimeout("reportBack();",100);
}
}
function reportBack()
{
alert(img.Height); // always report height correctly
}
Thanks for the help
GJHDigital:
can you post some code because I get the following error loading your page:
silverlight error message
errorcode: 2024
errortype: parseerror
message: invalid attribute value WrapWith Overflow for property TextWrapping.
XamlFile: xaml.php?=1257
line:25
position:73