Simple MVVM Walkthrough – Refactored–Part 2
In the previous post I showed an attempt to get rid of the magical strings. It worked great for a string property, but failed for the integer one as JR has reported. I decided to look into that, but this time around through TDD and this is what I found (besides the fact that going TDD way would definitely catch it).
When a string property is passed in, returned object is expected therefore there’s nothing complicated, it works. Though, when an integer (or any other type that is not a string) is passed in, .NET implicitly applies Convert() method.


