0

I'm having an issue in my ASP.NET WPF project, which a image inside a border is overflowing the border limits. Follow bellow my code:

        <Border CornerRadius="20" Grid.Column="0" Grid.Row="0"  >
            <Button HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
                <Image Source="{Binding ImagePath}" />
            </Button>
        </Border>
  • Does this answer your question? [How to make the contents of a round-cornered border be also round-cornered?](https://stackoverflow.com/questions/324641/how-to-make-the-contents-of-a-round-cornered-border-be-also-round-cornered) – Andy Dec 23 '19 at 13:13
  • @Andy this answer is not accurate, but thanks anyway. I find another solution – Fernando Calazans Dec 23 '19 at 16:57

1 Answers1

0

Actually I found a workaround for this different and more simple than

How to make the contents of a round-cornered border be also round-cornered?

Here is my solution:

<Border CornerRadius="20" Grid.Column="0" Grid.Row="0">
   <Button HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
   </Button>
   <Border.Background>
      <ImageBrush ImageSource="{Binding UploadImage}"/>
   </Border.Background>
</Border>