翻转时Windows 8 Metro按钮颜色更改

时间:2012-11-25 20:56:24

标签: windows-8 microsoft-metro

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

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

由于

1 个答案:

答案 0 :(得分: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>