1

How to make that system accent color is background color of status bar in Windows 10 mobile app? I cannot figure out how to convert theme resource to background color in c#... Thank you!

4

2 回答 2

0

无需在后面的代码中设置它。只需使用纯 xaml:

<Button Background="{StaticResource SystemControlBackgroundAccentBrush}"/>
于 2016-08-18T18:08:26.737 回答
0

您可以使用 Application.Current.Resources 获得它

例子

XAML

    <Button x:Name="myButton" >AAA</Button>

C#

myButton.Background = (SolidColorBrush)  Application.Current.Resources["SystemControlBackgroundAccentBrush"];

结果

结果

我希望这可以帮助你

于 2015-12-29T21:40:21.697 回答