I have a tab control with a content template defined. This content template has a text block tbInfo (just to simplify, in my case that is a user control). Then I create N tabs. Do I have internally N instances of tbInfo or is it just the same one refreshing when I change selected tab?
Asked
Active
Viewed 35 times
1 Answers
1
TabControl
recreates a view when user changes tab. This means, that whenever you select tab, you will have a fresh new control. This can be a real trouble when your views are very heavy. Then recreating a view can take quite long time.
This is why some people work around this, by storing created views and just showing them or not. See this question as a reference.
-
Thanks for a quick response. But when you say, it recreates a view, you mean it displays another instance of control or it updates the same instance of the control? – Andrew Oct 02 '15 at 11:56
-
When items have different templates (i.e. when you use `DataTemplateSelector`) new instances are created for sure. I don't know whether this applies to the situation, when template is the same for all items. – Kędrzu Oct 02 '15 at 14:53