Where should I put WPF specific code when using MVVM?
        Posted  
        
            by Surfbutler
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Surfbutler
        
        
        
        Published on 2010-04-16T16:50:01Z
        Indexed on 
            2010/04/16
            17:03 UTC
        
        
        Read the original article
        Hit count: 374
        
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
© Stack Overflow or respective owner