样式 Windows Phone 8.1/WinRT AppBarButton
Styling Windows Phone 8.1/WinRT AppBarButton
我目前正在寻求为 WinRT Windows Phone 8.1 应用程序实现 CommandBar。总的来说它非常简单,但我无法设置控件的样式。
我为我的应用设置了主题,因此强调色已更改为绿色。这适用于应用程序中的几乎所有地方(按钮、文本块等),但不适用于 AppBarButton。
我要覆盖的画笔是 SystemColorControlAccentBrush 和 PhoneAccentBrush 但更改它们不会对按下时 AppBarButton 的颜色产生任何影响:
知道我在做什么吗wrong/can这个颜色要改变吗?
设置 CommandBar 的前景色和背景色。
WindowsPhone 上的命令栏是系统 UI 而不是应用程序 UI,并且不允许自定义单个 AppBarButton 的颜色。它们的颜色始终来自 CommandBar 的颜色。
尝试更改应用栏按钮颜色
<AppBarButton x:Uid="SendMessageButton" Icon="Send" Foreground="" Background="" Command="{Binding SendMessageCommand}" IsEnabled="{Binding IsSendMessageButtonEnabled}"/>
或后面的代码发生变化
AppBarButton app = new AppBarButton();
app.Foreground="";
app.Background="";
我目前正在寻求为 WinRT Windows Phone 8.1 应用程序实现 CommandBar。总的来说它非常简单,但我无法设置控件的样式。
我为我的应用设置了主题,因此强调色已更改为绿色。这适用于应用程序中的几乎所有地方(按钮、文本块等),但不适用于 AppBarButton。
我要覆盖的画笔是 SystemColorControlAccentBrush 和 PhoneAccentBrush 但更改它们不会对按下时 AppBarButton 的颜色产生任何影响:
知道我在做什么吗wrong/can这个颜色要改变吗?
设置 CommandBar 的前景色和背景色。
WindowsPhone 上的命令栏是系统 UI 而不是应用程序 UI,并且不允许自定义单个 AppBarButton 的颜色。它们的颜色始终来自 CommandBar 的颜色。
尝试更改应用栏按钮颜色
<AppBarButton x:Uid="SendMessageButton" Icon="Send" Foreground="" Background="" Command="{Binding SendMessageCommand}" IsEnabled="{Binding IsSendMessageButtonEnabled}"/>
或后面的代码发生变化
AppBarButton app = new AppBarButton();
app.Foreground="";
app.Background="";