I have a bound list which would show different image at each item.
I know we could change the png image color by doing:
<Rectangle Height="100" Width="100" Fill="{StaticResource PhoneForegroundBrush}">
<Rectangle.OpacityMask>
<ImageBrush ImageSource="/Images/folder.png" Stretch="None"/>
</Rectangle.OpacityMask>
</Rectangle>
But this is for a specified image, what I want to do is to apply the same effect on a data bound image. like:
<Image Height="100" Width="100" Source="{Binding IconSource}" Stretch="None"/>
Is there anyone can help me?
Right, so since you can’t bind to a ImageBrush, here’s a workaround:
Using following converter:
That said, I would recommend using vector graphics (ie. a drawing) instead of a image.