View-Model-First Approach ? #2496
Unanswered
sigmarsson
asked this question in
General
Replies: 1 comment 1 reply
-
If you're trying to use VM first, that's not it. You need to have an implicit style (with a target type of your VM ) which will be the View for every VM in your app. When your VM in added to the visual tree, the implicit style will be added by the WPF framework. If you are going to use VM first, then make sure to opt-out of the ViewModelLocator. I personally don't recommend VM first as it create more coupling, it's more difficult to maintain, more difficult to debug, and much slower. Having said that, Prism doesn't care if you use VM first or not. Your design pattern is outside the scope of Prism. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ContentControl
in a way below ?I need to intialiaze View-Models and add them to
ViewModel.ContentPresenters
and in their respective View theAutowireViewModel="False"
. ThisPage
above is loaded into aTabView
causing this error unless I change theDataTemplate
above as :DataContext
or will it happen on the fly when problem 1# is resolved?In View's code-behind
DataContext
is being cast.Beta Was this translation helpful? Give feedback.
All reactions