Question

Suppose I have PathGeometry, consisting of lines, like this (the rectangle == panel, for example Grid): Examples I want to fill them to the bottom of the panel, like this: enter image description here The quick and not very good solution I see is to create additional curve with 2 additional points in the bottom and use it for filling.

Is there some better way to solve the task? Something like this (pseudocode):

 <Path Data=... FillStyle = "ToTheBottom" Fill="Blue"/>
Was it helpful?

Solution

There is no standard way of doing this; there is no Fill like this defined in WPF.

You could put two path geometries on top of each other. The bottom one would have a stroke thickness of 0 and has 2 extra points (those on the lower edge of the rectangle)

The second one the top would simply be the geometry you have now.

If you need to draw a lot of these you might create a custom control that does this for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top