public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var lang = value as string;

            if (string.IsNullOrWhiteSpace(lang))
            {
                return(null);
            }

            var ci           = new CultureInfo(lang);
            var locConverter = new LocalizationConverter();

            return(locConverter.Convert(lang, typeof(string), ci.DisplayName, CultureInfo.CurrentCulture));
        }
Ejemplo n.º 2
0
 public override object ProvideValue(IServiceProvider serviceProvider)
 {
     return(_LocalizationConverter ?? (_LocalizationConverter = new LocalizationConverter()));
 }
 public LocalizationBinding(string path)
     : base(path)
 {
     Converter = new LocalizationConverter();
 }
 public override object ProvideValue(IServiceProvider serviceProvider)
 {
     return _LocalizationConverter ?? (_LocalizationConverter = new LocalizationConverter());
 } private static LocalizationConverter _LocalizationConverter;