是否可以更改Button
按钮存在于工具栏中的文本颜色?
我尝试了以下app.xaml
<Style TargetType="{x:Type Toolbar}"> <!-- this changes the background colour -->
<Setter Property="Background" Value="AliceBlue"/> <!-- works -->
<Setter Property="Foreground" Value="Red"/> <!-- doesn't work -->
</Style>
我试过了
<Style TargetType="{x:Type Button}"> <!-- this changes both colours -->
<Setter Property="Background" Value="AliceBlue"/> <!-- works -->
<Setter Property="Foreground" Value="Red"/> <!-- work -->
</Style>
工具栏定义为:
<ToolBarTray Background="White" Width="Auto">
<ToolBar UseLayoutRounding="True" >
<Button Content="Options" Name="btnOptionsSettings" Click="btnOptionsSettings_Click" ></Button>
<Button Content="Timer" Name="btnTimerSettings" Click="btnTimerSettings_Click" ></Button>
<Button Content="Blocks" Name="btnBlocks" Click="btnBlocks_Click" ></Butto
</ToolBar>
</ToolBarTray>