Is it okay if my ViewModel 'creates' bindable user controls for my View?
Posted
by j0rd4n
on Stack Overflow
See other posts from Stack Overflow
or by j0rd4n
Published on 2010-05-23T14:36:55Z
Indexed on
2010/05/23
14:40 UTC
Read the original article
Hit count: 230
I have an entry-point View with a tab control. Each tab is going to have a user control embedded within it. Each embedded view inherits from the same base class and will need to be updated as a key field on the entry-point view is updated.
I'm thinking the easiest way to design this page is to have the entry-point ViewModel create and expose a collection of the tabbed views so the entry-point View can just bind to the user control elements using a DataTemplate on the tab control.
Is it okay for a ViewModel to instantiate and provide UI elements for its View?
© Stack Overflow or respective owner