0
当你按下一个按钮appbar - 这就是风格:的Windows 8.1的应用程序 - AppBarButton按下按钮样式
但随后变回默认样式。 为了让用户知道他们按下了按钮,我希望样式与按下的样式相同。
当按钮被点击时,我做了按钮样式的开关。
if (button.ClickMode == ClickMode.Release)
{
button.Style = Application.Current.Resources["PressedAppBarButtonStyle"] as Style;
}
我试图保持这个简单的和做的:
<Style x:Key="PressedAppBarButtonStyle" TargetType="AppBarButton">
<Setter Property="Foreground" Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
<Setter Property="Background" Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
</Style>
这是得到的图像:
问题。背景颜色不是我认为会得到的白色背景。我甚至放入了诸如红色,蓝色,紫色等颜色的名称,但它没有改变背景颜色。
有关如何让背景颜色像按下按钮样式一样白的任何建议?
谢谢。