Matvey
Matvey

Reputation: 163

WPF MVVM two views, one view model

I am writing an application, which supposed to be running on 2 monitors, when then small monitor displays the light version of the same information displayed on the large one.

What is the best way to implement this using MVVM model?

I have thought to create one view model and two views, and set the datacontext of those views to be the view model. Is it a right way to implement this ?

Thanks

Upvotes: 4

Views: 1600

Answers (1)

Moses Aprico
Moses Aprico

Reputation: 2121

I have thought to create one view model and two views, and set the datacontext of those views to be the view model. Is it a right way to implement this ?

As a comment a above stated, VM doesn't care about how it is used, so you can use 1 VM as View's DataContext as many as you want to.

Upvotes: 1

Related Questions