您的位置:首页 > 其它

x:static 标记扩展用法小结

2011-05-16 21:30 246 查看
1. <Button Content=”{x:Static sys:DateTime.Now}” />

2. 在MainWindow中设一个静态变量名为Now:

<Button Content=”{x:Static local:MainWindow.Now}” />

<Button Background=”{x:Static Brushes.AliceBlue}” />

3. <Button Background=”{DynamicResource

{x:Static SystemColors.ActiveCaptionBrushKey}}”>

Hello</Button>

4. 在Resources中设置静态值,在xaml中引用

<x:Static x:Key=”test” Member=”sys:DateTime.Now” />

<Button Content=”{StaticResource test}” />

5. <Button Content=”Hello”>

<Button.Foreground>

<x:Static Member="SystemColors.ActiveCaptionBrush" />

</Button.Foreground>

</Button>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: