jbruening / ugui-mvvm

Unity3D uGUI mvvm databinding via the standard IXChanged interfaces used in wpf (INotifyPropertyChanged, INotifyCollectionChanged, etc)
Other
214 stars 41 forks source link

Make the generic ValueConverter methods virtual #32

Closed ritijain closed 5 years ago

ritijain commented 5 years ago

Recently ran into a use case where a user might want to perform some sort of application specific pre-processing or post processing on the item mapping key-value pairs .

Example - the keyvalue pair could be an enum -> string mapping, but if we want a localized string, the string mapped result might need app specific post processing.

ryantrem commented 5 years ago

Seems reasonable. Though for the specific example you give above, in the past I've seen IValueConverter implementations that just aggregate other IValueConverters into a pipeline. So in your case above, you'd have a converter that went from an enum to a string (resource key), and then another converter that went from a resource key to a resource. Regardless, I think making these virtual seems pretty harmless and enables some new scenarios.