日期:2014-05-20  浏览次数:20756 次

wpf xaml 语法(与括号相关)
用Blend时使用触发器,生成这样的代码:

<Storyboard x:Key="OnMouseEnter1">
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle">
<EasingColorKeyFrame KeyTime="0" Value="#FFEFA2A2"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>


Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
双引号中什么情况下要加括号?去掉括号会报错,括号位置括错也报错

还有为什么前面要加个Shape?Rectangle继承Shape本身不就有Fill属性,为何不直接:
(Fill).(SolidColorBrush.Color)或者Fill?

有人知道哪里可以找到这方面的语法么?英语的资料也可以

------解决方案--------------------
http://blogs.charteris.com/blogs/patl-closed/archive/2007/03/20/Complex-PropertyPath-syntax.aspx
试试这个可以访问吗~
或者搜索下:PropertyPath XAML 和Storyboards Overview 最好找msdn的