WPF: how to make the path size match its parent size

Say in blend, I take a pen tool and I just create a closed shape.

I would like this shape width (or height) to stretch to the size of the container.

So let's say I have

<Grid Width="500"> <Path Data="Bla Bla" Width="200"> </Grid> 

In other words, how can I make the width of the path the corresponding parent. I'm trying to just go

 <Canvas Width="500"> <Path Data="Bla Bla" HorizontalAlignment="Stretch"> </Canvas> 

but that will not work. It works with a rectangle, but not with a path, so how can I do this with a path?

+4
source share
1 answer
 <Viewbox> <Path .../> </Viewbox> 
+5
source

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


All Articles