读书人

关于silverlight3的一个样式封装有关问

发布时间: 2012-02-28 13:06:36 作者: rapoo

关于silverlight3的一个样式封装问题
首先我用的是silverlight3版本,我在在App.xaml中定义了一个全局样式
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SilverlightApplication2.App"
>
<Application.Resources>
<Style x:Key="ButtonStyle1">
<Setter Property="FontFamily" Value="华文彩云"></Setter>
<Setter Property="FontSize" Value="24"></Setter>
<Setter Property="Foreground" Value="Green"></Setter>
<Setter Property="Background" Value="Red"></Setter>
</Style>
</Application.Resources>
</Application>

我运行程序的时候提示:属性 Property 的属性值 FontFamily 无效
经过测试所有的Property 的属性值都提示无效。
难道是版本3写法不同了?

[解决办法]
你要打开的是什么控件的属性,

比如这样 <Style x:Key="ButtonStyle1" TargetType="Button" >

读书人网 >CAD教程

热点推荐