ArcGISPortalViewer.Popup.Converters.StringFormatToBitmapSourceConverter.Convert C# (CSharp) Method

Convert() public method

public Convert ( object value, Type targetType, object parameter, string language ) : object
value object
targetType System.Type
parameter object
language string
return object
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var dict = value as IDictionary<string, object>;
            var formatter = parameter as string;
            if (dict == null || string.IsNullOrWhiteSpace(formatter))
                return null;
            if (!string.IsNullOrEmpty(formatter))
            {
                var uriString = AttributeBindingHelper.ResolveBinding(dict, formatter);
                if (Uri.IsWellFormedUriString(uriString, UriKind.Absolute))
                    value = new BitmapImage(new Uri(uriString));
            }
            return value;
        }
StringFormatToBitmapSourceConverter