I have a Path that must resize to its StackPanel container.
If you want this with a constant stroke width that isn't scaled, you can use a custom Shape
. Shapes in WPF effectively encapsulate scaling a geometry and applying a stroke afterwards, which means you can have a scaled path that also always has the same stroke width.
Creating a shape is quite easy:
public class MyShape : Shape
{
public override Geometry DefiningGeometry
{
get
{
// Create your geometry here
}
}
}