我正在尝试在 WPF 中实现一个按钮,当您单击它时会显示一个菜单。我已经完成了所有工作,控件的 ControlTemplate 如下所示。(该控件扩展了 ToggleButton)。
<Border x:Name="Border" Padding="3" CornerRadius="1" BorderThickness="1"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" IsHitTestVisible="True">
问题是,仅当用户单击路径绘制的小箭头时才会显示菜单。有什么办法可以让整个边框 HitTestVisible?