Search code examples
naming-conventionsconvertersmvvmcross

Custom names for MvvmCross converters


Coming from a WPF background I am used to naming all value converters with the postfix word "Converter". I can do the same in MvvmCross however the usage style in the Android Axml is without the converter postfix.

Is it possible to still include the postfix word Converter without manually registering?


Solution

  • By default, MvvmCross registers the value converters using this filler - https://github.com/MvvmCross/MvvmCross/blob/v3.1/Cirrious/Cirrious.MvvmCross.Binding/Binders/MvxValueConverterRegistryFiller.cs#L20

            name = RemoveTail(name, "ValueConverter");
            name = RemoveTail(name, "Converter");
    

    If you want to replace this registry filler, then you can: