You can use a converter. ConverterParameter
is used to specify BaseURI and binding value will contain image name.
public class ImagePathConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return string.Format("{0}{1}.jpg",parameter, value);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
Then in xaml:
<Image Source="{Binding ImageName, Converter={StaticResource Converter, ConverterParameter='http://www.something.com/something/something/'}}"/>
For now I hard coded .jpg
in converter, you can add it as a parameter if you want it to be a variable.