C#如何使UWP XAML按钮在悬停时不显示边框

C#如何使UWP XAML按钮在悬停时不显示边框,c#,xaml,uwp,C#,Xaml,Uwp,这是我的按钮: <Button x:Name="buttonClear" Width="74" Height="52" Margin="3,175,0,0" Padding="8,1,8,5" HorizontalAlignment="Left" VerticalAlignment="Top" Content="C" FontSize="2

这是我的按钮:

    <Button
        x:Name="buttonClear"
        Width="74"
        Height="52"
        Margin="3,175,0,0"
        Padding="8,1,8,5"
        HorizontalAlignment="Left"
        VerticalAlignment="Top"
        Content="C"
        FontSize="24"
        FontWeight="Normal"
        FocusVisualPrimaryBrush="Transparent"
        FocusVisualSecondaryThickness="0"
        Style="{ThemeResource ButtonRevealStyle}"
        Click="ButtonClear_Click" />
我想它会消除鼠标指针悬停在按钮上时显示的灰色边框。但它不起作用

我还尝试将以下内容添加到App.xaml:

<Application.Resources>
    <SolidColorBrush x:Key="ButtonBackgroundPointerOver">Transparent</SolidColorBrush>
</Application.Resources>

透明的

仍然没有结果。我必须在其他地方引用该键吗?

您需要修改
按钮的完整样式。完整的
按钮
样式具有悬停的
VisualState
定义。只需修改或删除其故事板

查看此链接,您将找到完整的默认按钮样式定义。


我个人创建了一个导入到所有页面的资源字典文件,当我定义新按钮时,我在资源字典中将
BasedOn设置为我修改过的按钮样式。

最简单的解决方案就是用
BorderThickness=“0”


或者,您可以按照visc的建议编辑按钮的完整样式。

我真的没有那么高级,所以我不知道如何正确操作。@EsAMe,如果答复有帮助,请将其标记为“答案”。
<Application.Resources>
    <SolidColorBrush x:Key="ButtonBackgroundPointerOver">Transparent</SolidColorBrush>
</Application.Resources>