Filling a non-closed PathGeometry to the bottom

Suppose I have a PathGeometry consisting of rows like this (rectangle panel ==, for example Grid ): Examples I want to fill them at the bottom of the panel, for example: enter image description here The quick and not-so-good solution that I see is to create an extra curve with two extra points at the bottom and use it to fill.

Is there a better way to solve the problem? Something like this (pseudo code):

  <Path Data=... FillStyle = "ToTheBottom" Fill="Blue"/> 
+4
source share
1 answer

There is no standard way to do this; WPF does not have the value Fill as defined in WPF.

You can put two path geometries on top of each other. The lower one has a stroke thickness of 0 and has 2 additional points (on the lower edge of the rectangle).

The second vertex will be just the geometry that you now have.

If you need to draw a lot of them, you can create a custom control that does this for you.

+5
source

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


All Articles