Coffeehouse Post

Single Post Permalink

View Thread: Do you find WPF to be unnatural / unlogical?
  • User profile image

    , MasterPie wrote

    But at that point, it would seem that the View Model isn't exactly independent of the view if you're defining presentation properties specifically for the view.

    Right now, I have a property "UserEngaged:bool" and based on that property, I want to change the background color of my view, hide and show some elements, and change the foreground of some other elements...ValueConverters converting from bool to the right types. Making those into properties would mean coding up specifically for the views and user controls that I am using, which I feel defeats the purpose of the design pattern. 

    I agree. The ViewModel should know nothing about the view. However, if it's something that can be abstracted to UserEngagedColor instead of BackgroundColor, then different views can make different uses of that property. I admit, it's a stretch, but I've come to the conclusion that my apps rarely have more than one view on a viewmodel anyway, so the design beneft of separating the two disappears.