Can anyone clarify these terms please.
I find them to be very vague or context-dependent.
For example we have a VM with the items list. The selection affects not only the accesibility of the buttons (i.e. command can execute) but also the behavior of VM: it matters one ore several items need simultaneous editing.
The second example is the process of creating a new item.
After user provided data we add item to items collection thus inserting it in the list and want to make it selected and focused. Now we do this by introducing IsSelected
and IsFocused
properties for item's VM. The real job is done by the View via bindings, attached properties and behaviors.
Some members of our team insits that adding such kind of properties (IsVisible
, IsSelected
, IsFocused
an etc.) to VMs brings UI logic to VM and that is not a good practice because UI and presentation logic are mixed.
For me following patterns is importand but more important not to repeat myself. I prefer bindings and few lines in codebehind without casting DataContext to concrete VM's type, calling VM's methods and so on.
Nevertheless I do not like HolyWars and admit I can be wrong due to misunderstanding of these two terms and the criteria of separation one from the other.