我想在Windows Phone应用程序中拥有动画全景控制背景。将WritableBitmap分配给ImageBrush.ImageSource属性
我有一个算法,不断地在WritableBitmap上绘制所需的图像。
我已经将Panorama的背景属性绑定到ViewModels的BackgroundImageBrush属性。
然后在我的ViewModel的施工时间我给你
BackgroundImageBrush = new ImageBrush {ImageSource = _outputWriteableBitmap};
我得到的输出没有绑定错误,当我在检查与调试器的结合,我得到BackgroundImageBrush.ImageSource正确连接到WritableBitmap 。
每次我重画_outputWriteableBitmap时,我都会调用Invalidate。
仍然我的全景背景是空白的!
我在理论上做错了什么?在Windows Phone的Panorama中甚至有可能拥有动画背景吗?
谢谢。
你是否为'BackgroundImageBrush'激发'PropertyChanged'事件,以便你的UI知道它已经改变了? – ChrisF 2011-06-10 10:21:15
是的,我愿意。但只有当我将WritableBitmap链接到ImageBrush的ImageSource属性时才会发生。 – 2011-06-10 12:54:33
看看杰夫威尔科克斯实现衰落动画。它可能很有用:http://www.jeff.wilcox.name/2010/11/wp7-panorama-smooth-background-changing/ – keyboardP 2011-06-10 15:13:18