Channel9Downloader.Converters.TagTitleToCharacterConverter.Convert C# (CSharp) Method

Convert() public method

Converts a string value to the first character in upper case.
public Convert ( object value, Type targetType, object parameter, CultureInfo culture ) : object
value object The value produced by the binding source.
targetType System.Type The type of the binding target property.
parameter object The converter parameter to use.
culture System.Globalization.CultureInfo The culture to use in the converter.
return object
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var title = value as string;
            if (title == null)
            {
                return string.Empty;
            }

            var character = title.Substring(0, 1).ToUpper();
            return character;
        }
TagTitleToCharacterConverter