Where to put WPF specific code when using MVVM
- by Surfbutler
I'm just getting up to speed on MVVM, but all the examples I've seen so far are binding View controls to simple non-WPF specific data types such as strings and ints. However in our app I want to be able to set a button's border brush based on a number in the Model.
At the moment, I translate the number into a brush in the ViewModel to keep the View XAML only, but is that right?
I don't like putting WPF specific code in the ViewModel, but equally I don't like the idea of putting code-behind on my View panel.
Which is the best way?
Thanks