I develop .NET/Winforms applications that runs on various kiosks. These apps are typically full-screen and touch-controlled. Newly I would like to use WPF technology and MVVM design pattern.
Viable design of these applications is that I have one MainForm (Window) that switches screens (UserControls) on it. So you have only one "current" screen with buttons like Previous, Next (like an wizard).
Most of the applications have very similar logic. They eg. need to get OrderNumber (PIN, any text..) from user (one screen), process payment by card (second screen),... What differs accross applications is GUI: images, fonts, colors, monitor resolutions, buttons locations,...
My idea is to write typical ViewModels and put them in common library. Specific applications then would provide their Views for these ViewModels. Every ViewModel will then be bound to one specific View during whole application life.
Example:
Library Common.dll
- contains typical ViewModels: ScreenGetTextViewModel, ScreenPayByCardViewModel,...
- (contains also default Views for ViewModels)
Application 1:
- references Common.dll
- contains Views for Client 1: ScreenGetTextView, ScreenPayByCardView,... (these views are bound to ViewModels from Common.dll)
Application 2:
- references Common.dll
- contains Views for Client 2: ScreenGetTextView, ScreenPayByCardView,... (these views are bound to ViewModels from Common.dll)
MVVM looks to me like the right way to achieve my requirements, because of logic and GUI separation.
My question is how to make this in WPF, what to use, where to inspire myself. I prefer simple solutions without 3rd party MVVM toolkits (if it's reasonable and possible).
Some sub-questions/ideas:
How to specify what View should bind to particular ViewModel? Use some ViewLocator? Put "View" property to ViewModel?
I prefer write the Common.dll not coupled to WPF because of possible UWP applications in future (if reasonably possible).
Thank You