In Silverlight 5, when would it be most appropriate to use a custom markup extension over a type converter? Say for instance, I want to supply a text input which should be converted to ProperCase. Which of these two would be most appropriate for this scenario?
Share
Your scenario calls for a Value converter, as it’s semantically a value conversion.
custom markup extension covers other cases:
1) The scenario can be done using existing binding options, but will lead to complicated/verbose binding expression (copy&past is your friend), and probably registering otherwise useless static resources
for instance, implementing multilanguage resources using Binding expressions: “{Binding AppStrings[MyStringId], Source={staticResource myResources} }”
With the adequate markup extension, it becomes “{ext:Translations AppMyStringId}” (a lot better, no?)
2) The scenario is inachievable using existing binding options.
(Dynamic loading of resources from the web, and autodiscovery for instance.)