最簡單的方法是重寫主題背景刷在你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>
你是如何設置背景的?如果在代碼中,請顯示相關的片段。 –