I want to place a static rectangle on top of an image.
The rectangle should be a percentage of the image size (like 80%) regardless of the image size.
I have tried to put the image in a Canvas and as a Canvas background but then I can’t get the image to fill the surrounding area.
<Canvas Grid.Row="1" Grid.Column="0">
<Canvas.Background>
<ImageBrush ImageSource="{Binding Path=Image1}"/>
</Canvas.Background>
</Canvas>
Put it in a grid, and then put the rectangle in the same row and column. And use a converter to get 80% the size.
XAML:
C# (Converter):