wpf - Cache ContentControl/ContentPresenter Bound to ViewModel -
if have contentcontrol/contentpresenter content set viewmodel - , have type-referential data template viewmodel - there clean, mvvm-compliant way take "snapshot" of contentcontrol/contentpresenter when has rendered everything?
the idea have 3 or 4 viewmodels "open" @ given point in time, , have listbox bound collection of viewmodels. there 1 contentcontrol/contentpresenter displaying "current" view model being viewed. if user moves mouse on 1 of viewmodels in listbox, want display scaled down preview of viewmodel them. rather rendering content everytime, want cache content viewmodel once has been displayed in main contentpresenter.
has seen before?
chris
you can create bitmap of visual using rendertargetbitmap. bitmap include entire visual tree of visual.
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.rendertargetbitmap.aspx
Comments
Post a Comment