读书人

为什么要这样设置属性?解决方案

发布时间: 2012-04-05 12:42:40 作者: rapoo

为什么要这样设置属性?
xmal:

XML code
<StackPanel Name="skplMain" Background="YellowGreen" Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center" ></StackPanel>


C#:skplMain.Projection.SetValue(PlaneProjection.RotationZProperty, slZ.Value);

为什么不能这样:skplMain.Projection.RotationZProperty = 10.0;?

[解决办法]
这就是依赖属性和普通属性的区别了。
[解决办法]
你不能对该属性直接赋值因为这个属性是依赖属性。

读书人网 >CAD教程

热点推荐