Value converter without reference to the source image

I need to get the image path through a value converter. However, I cannot find examples of using a value converter without binding.

I would like to do something like that:

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

Then the image converter checks the folder with the image and returns the correct path to the file.

+3
source share
1 answer

Why not just use it Bindinglike this:

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

Is this enough?

+7
source

Source: https://habr.com/ru/post/1716096/


All Articles