In WPF, is there an easy way to add wavy underlines (like spelling errors in Word) to FlowDocument
elements? There's the Underline
class, but there seems to be no way to style it.
You can create the wavy effect using the following changes to Robert Macne's solution
Add a visual brush to the Grid.Resources section:
<VisualBrush x:Key="WavyBrush" Viewbox="0,0,3,2" ViewboxUnits="Absolute" Viewport="0,0.8,6,4" ViewportUnits="Absolute" TileMode="Tile">
<VisualBrush.Visual>
<Path Data="M 0,1 C 1,0 2,2 3,1" Stroke="Red" StrokeThickness="0.2" StrokeEndLineCap="Square" StrokeStartLineCap="Square" />
</VisualBrush.Visual>
</VisualBrush>
And change the pen to:
<Pen Brush="{StaticResource WavyBrush}" Thickness="6" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With