bto.rdz bto.rdz - 1 year ago 151
C# Question

LineSegment.IsStroked missing in UWP

In Wpf you can

<Path Stroke="White" Fill="#50ffffff" StrokeThickness="2">
<PathFigure StartPoint="20,20">
<LineSegment Point="100,20" />
<LineSegment Point="100, 100" IsStroked="False"/>
<LineSegment Point="20, 100"/>
<LineSegment Point="20, 20"/>

To get

enter image description here

Sadly in UWP there is no
property in the
class, is there any know workaround for this case?


Answer Source

To overcome this limitation, you should be able to break down the Path into multiple Paths, skipping the areas without stroke. In the sample code, you could even keep it as a single Path by starting in the upper right corner and continuing counter-clockwise, ending in the lower right corner.

In more complex scenarios, having multiple Paths is a bit less clean than in WPF, but it should be a functional solution.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download