最简单的方法是重写主题背景刷在你App.xaml
这样
<Application.Resources>
<SolidColorBrush x:Key="InkToolbarButtonBackgroundThemeBrush">Transparent</SolidColorBrush>
</Application.Resources>
如果你想要更多的控制,您可以包含所有按钮样式为BasedOn
的样式。
<Application.Resources>
<Style x:Key="InkToolbarCommonButtonStyle"
TargetType="ToggleButton">
<Setter Property="MinWidth"
Value="{ThemeResource InkToolbarButtonWidth}" />
<Setter Property="MinHeight"
Value="{ThemeResource InkToolbarButtonHeight}" />
<Setter Property="MaxWidth"
Value="{ThemeResource InkToolbarButtonWidth}" />
<Setter Property="MaxHeight"
Value="{ThemeResource InkToolbarButtonHeight}" />
<Setter Property="BorderThickness"
Value="0" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="Foreground"
Value="{ThemeResource InkToolbarButtonForegroundThemeBrush}" />
<Setter Property="FocusVisualMargin"
Value="-3" />
</Style>
</Application.Resources>
你是如何设置背景的?如果在代码中,请显示相关的片段。 –