How to know when all controls and templates are loaded (Windows Phone 7)
I am trying to lazy load the Image Source for the Image Control but the problem is that I have to wait for all controls loaded so that I can use VisualTreeHelper to access to the Image control (which inside a datatemplate).
I tried with Loaded event, LayoutUpdated even, ApplyTemplate like in the manual of msdn but for all of them, when I tried to get the container for Image Control, it is null
var containerItem = FeedsPanorama.ItemContainerGenerator.ContainerFromIndex(selectedIndex);
var imageControl = VisualElementHelper.FindName<Image>("ImageThumbnail", containerItem);
new ImageUtility().GetImag开发者_运维知识库eAsyn(new Uri(selectedItem.SummaryImageLink, UriKind.Absolute), imageControl);
The same code will work when I handle in Selection_Changed event of FeedsPanaroma
Have you tried the Loaded event for the page?
I tried to work around so that I don't have to deal with the Loaded Event. I wrote a new ImageConverter so that I can use that tag to replace the Image tag. It works like a charm
精彩评论