I want to have an image bound to a boolean and have the source of the image to depend on the boolean value
i.e. true source="image1" false source="image2"
I was wondering if there is a way to do it inline without need for a converter.
bindingboolean-expressionconditionalconverterswpf
I want to have an image bound to a boolean and have the source of the image to depend on the boolean value
i.e. true source="image1" false source="image2"
I was wondering if there is a way to do it inline without need for a converter.
Best Answer
You can create a style on the Image which uses a DataTrigger to swap the image source depending on a binding. In this example the image changes depending on the value of a boolean called simply "Value".