![](/img/trans.png)
[英]Is it possible for a Windows Phone application communicate with the Web service, if it is not in the foreground state?
[英]Setting foreground for whole Windows Phone's application
如何更改应用程序中所有控件的前景色? 我需要更改颜色:文本框,文本块,按钮边框。
一个接一个(超过100个控件)需要很长时间。
这就是样式的用途。 您可以在app.xaml
文件中添加样式。 就像是:
<Application.Resources>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="White" />
</Style>
<Style TargetType="TextBox">
<Setter Property="Foreground" Value="White" />
</Style>
</Application.Resources>
假设您正在为Windows Phone 7.1(Mango)或更高版本编程,您可以在App.xaml
文件中使用Style,在Application.Resources
标记内添加以下代码并根据需要进行自定义。 样式将应用于应用程序中的所有页面(您仍可以直接在相应的元素标记中覆盖单个属性)。
<Application.Resources>
<Style TargetType="Button">
<Setter Property="Foreground" Value="Red"/>
<Setter Property="FontSize" Value="20"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Blue" />
</Style>
</Application.Resources>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.