c# - Should the view model match closer to view or model? -
let's have view has view model data context. binded property called visible.
what type should property ?
- boolean (more model friendly, forces use of converter) ?
- visibility (more view friendly) ?
leave bool value in viewmodel , use booltovisibilityconverter in view.
reason:
viewmodel should view-agnostic, , ui-framework-agnostic. is, should able copy viewmodel console application , hit f5.
make sure leverage markupextension simplify converter usage
Comments
Post a Comment