【发布时间】:2020-12-10 23:46:03
【问题描述】:
嗨,我有一个用例,我需要绘制一个复杂的形状(这里是半圆,只是为了演示)我已经使用 PATH Uwp 类完成了现在我需要在 PATH 的区域内制作为可点击的(即用户应该能够单击使用 PATH 绘制的形状的覆盖区域)。这是 XAML,任何人都知道如何实现然后请分享这将有很大帮助。谢谢
<Canvas Width="300" Height="300" Background="DarkGray">
<Path Stroke="Black" Fill="Purple" StrokeThickness="4" >
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="0,100">
<PathFigure.Segments>
<ArcSegment x:Name="UpperArcSegment"
IsLargeArc="True"
Size="20,20"
SweepDirection="Clockwise"
Point="200,100" />
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
</Canvas>
【问题讨论】: