1

我正在构建一个 Metro 应用程序。我已将背景颜色设置为黑色,将前景设置为白色。当我构建、测试和翻转按钮时,它的颜色变为白色。这不适用于我的配色方案。

如何防止按钮在翻转时改变颜色?

谢谢

4

1 回答 1

2

你知道你需要为单个按钮(或应用程序中的按钮子集)做什么。但是,如果您想对应用程序中的所有按钮执行此操作,则可以在 app.xaml 中覆盖:

    <ResourceDictionary.ThemeDictionaries>
        <!-- When not in high contrast mode, use a colorful look. 
                                Note that this is defining an implicit style that is scoped to this StackPanel. -->

        <ResourceDictionary x:Key="Default">
            <Thickness x:Key="ButtonBorderThemeThickness">2</Thickness>
            <SolidColorBrush x:Key="ButtonForegroundThemeBrush" Color="#FFFFFFFF" />
            <SolidColorBrush x:Key="ButtonBackgroundThemeBrush" Color="#FF0088B4" />
            <SolidColorBrush x:Key="ButtonPointerOverForegroundThemeBrush" Color="#FF0088B4" />
            <SolidColorBrush x:Key="ButtonPointerOverBackgroundThemeBrush" Color="#FF7ED1EC" />
            <SolidColorBrush x:Key="ButtonPressedForegroundThemeBrush" Color="#FF0088B4" />
            <SolidColorBrush x:Key="ButtonPressedBackgroundThemeBrush" Color="#FFFFFFFF" />
            <SolidColorBrush x:Key="ButtonBorderThemeBrush" Color="#FF0088B4" />
            </ResourceDictionary>
        </ResourceDictionary.ThemeDictionaries>
于 2012-11-26T02:28:00.127 回答