HolaMan wrote:
> I have no idea why Image does not work but TextBlock's Text work. Any
> suggestions? :-(
It doesn't work because Image's Source property is not of type string, it
is of type ImageSource. The only reason you can put a string there in XAML
is because when XAML is parsed, the parser uses the converter architecture
to translate the string into a real ImageSource. At runtime though, when
the Binding is occuring, it's gotta be a real ImageSource instance. Therefore,
if your datasource is providing you with a string, you'll need to implement
an IValueConverter[1] to translate that string into a real ImageSource. My
recommendation would be to simply use the ImageSourceConverter's[2] ConvertFrom
method inside of your IValueConverter's Convert implementation.
HTH,
Drew
[1]
http://windowssdk.msdn.microsoft.com...eConverter.asp
[2]
http://windowssdk.msdn.microsoft.com...eConverter.asp
___________________________________
Drew Marsh
Chief Software Architect
Mimeo.com, Inc. -
http://www.mimeo.com
Microsoft C# / WPF MVP
Weblog -
http://blog.hackedbrain.com/