silverlightwindows-phonepanorama-controlimagebrush

Assign WritableBitmap to an ImageBrush.ImageSource property


I want to have an animated panorama control background in Windows Phone application.

I have an algorithm that constantly draws onto the WritableBitmap the desired image.

I have bound the Panoramas' background property to ViewModels' BackgroundImageBrush property.

Then at construction time of my ViewModel I assign

BackgroundImageBrush = new ImageBrush {ImageSource = _outputWriteableBitmap};

I get no Binding errors in output and when I check the binding at with the debugger, I get the correct linkage of BackgroundImageBrush.ImageSource to a WritableBitmap.

Every time I redraw the _outputWriteableBitmap I do call Invalidate.

Still my panorama background is blank!

What am I doing wrong in theory? Is it even possible to have an animated background in Windows Phone's Panorama?

Thanks.


Solution

  • A way offered in the comments below the question has the potential answer.

    This blog post shows how to at least change the panorama background at runtime, tough I didn't manage get it to play animation generated at runtime.