JFoulkes
JFoulkes

Reputation:

Value Converter Without Binding On Image Source

I need to get the path of an image through a value converter. However I can't find any examples of using a value converter without binding.

I would be looking to do something along these lines:

<Image source="{Value=Image1, Converter={ImageConverter}}" />

The image converter will then go check an image folder and return the correct file path.

Upvotes: 3

Views: 2978

Answers (1)

Kent Boogaart
Kent Boogaart

Reputation: 178660

Why not just use a Binding like this:

<Image Source="{Binding ., Converter={StaticResource ImageConverter}, ConverterParameter=Image1}"/>

Won't that suffice?

Upvotes: 7

Related Questions