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

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -