none
How to change converter language parameter to culture info?

    Question

  • I'm porting over some converters from Windows Phone to WinRT.  Here is a sample converter:

            public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                var resourceName = value.ToString() as string;
                return local.ResourceManager.GetString(resourceName, culture);
            }

            public object ConvertBack(object value, Type targetType, object parameter, string language)
            {
                throw new NotImplementedException();
            }

    If I change the System.Globalization.CultureInfo culture parameter to a string language parameter to make the Convert() call compatible with WinRT's IValueConverter interface, how do I convert the string language parameter to a System.Globalization.CultureInfo value the GetString() call understands?


    -- roschler

    Friday, January 24, 2014 11:33 PM

Answers

All replies