I need my application to render an image only when it becomes visible to the user. I tried attaching. I've tried the following (f#):
image.IsVisibleChanged.Add(fun e ->
if image.IsVisible & mtvCapture.Capture <> null then
mtvCapture.BeginCapture()
)
But this just loads, doesn't lazy load. How does IsVisible work, will this only be true when the users scrolls the image element into view?
Also tried modifying the binding source like so:
public ImageSource ImageElementSource
{
get
{
if (Capture == null)
{
BeginCapture();
return loadingImageSource;
}
CaptureToWpfImage();
return imageElement.Source;
}
}
How can I have BeginCapture() be called only when image is scrolled into view?