I'm caching Views in XAML in order to improve performance (don't need to load the controls again). Does this make sense / improve performance of loading controls?
Problem is, although I'm caching / loading the same thing, it seems when I use the Cached View, it has a different appearance. I think it's not using the ItemTemplateSelector properly.
var stringKey = GetMIVMString(mivm);
if (_MyCachedView.ContainsKey(stringKey))
{
MainView.Content = _MyCachedView[stringKey];
}
else
{
var view = new MyInnerView() { DataContext = mivm };
MainView.Content = view;
var itemToCache = MainView.Content as MyInnerView;
if (itemToCache != null)
{
_MyCachedView.Add(stringKey, itemToCache);
}
}
Thanks!