I have a question about bitmap caching in windows phone 7 silverlight applications.
When shall i use it? And on what controlls? Should i bitmap cache children of a controll thats bitmap cached? I'm not sure how its works and it would be nice to get some advice from you guys.
/Richard
I found this link explaining CacheMode
in Silverlight 3. From the link:
[This link is dead.]
<param name="EnableCacheVisualization" value="true" />
I wonder if the EnableCacheVisualization
can be enabled for WP7, I'm using BitmapCache
for a LongListPicker
and a ContentPresenter
(that I populate with dynamically created content) and it'd be interesting to know if the caching is working. But according to the 3rd bullet, you should be using it only if you're animating UIElement
s, which I'm not, so maybe I shouldn't be using it at all!
BitmapCache should, for the large majority of objects, be something you don't need to think about on Windows Phone 7. Silverlight for WP7 implements automatic bitmap caching of elements that are animating in ways that caching helps (translate, opacity, rotate - maybe more, I can't recall now).
Silverlight on a desktop PC (or Mac) isn't quite as smart currently, so you need to manually specify CacheMode=BitmapCache on objects using roughly the guidance pointed to by Praetorian in his answer.
There are probably edge cases where setting BitmapCache explicitly is useful even on Windows Phone, but I don't know about them offhand. You could try looking at the Windows Phone Performance Tips on MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With