Keep ellipse height and width

I just want to have several ellipses that no matter how the container changes, the height and width should always be the same. I found a solution, but it is too slow, I will post it here to illustrate what I want to do. Let me know if you have any ideas on a good way to achieve this.

<Grid> <Ellipse Width="Auto" Height="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}" Stroke="Black" StrokeThickness="2" /> </Grid> 

Thanks! =)

+4
source share
1 answer

Set the stretch to one: http://msdn.microsoft.com/en-us/library/system.windows.media.stretch.aspx

 <Grid> <Ellipse Fill="Red" Stretch="Uniform"/> </Grid> 
+3
source

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


All Articles