I have an entity class. This entity has lots of properties and entity\'s data is shown to the user in several TabItems
of a TabControl
. I also impl
You don't have anything to do, that's the default behavior. The DataTemplate
for a TabItem
content won't be instantiated until this TabItem
is selected
EDIT: here's an example:
...
In the code above, the TabControl
will pick the appropriate DataTemplate
based on the item type, and will render it only when that item is selected.
EDIT 2: apparently you want to display the data of a single ViewModel on several pages. If you want the controls of each TabItem
to lazily instantiated, you need to use the ContentTemplate
property of each TabItem
: