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”>
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>
<x:Static Member="SystemColors.ActiveCaptionBrush" />
</Button.Foreground>
相关文章推荐
- Java中static、final用法小结
- Java中static、final用法小结
- static用法小结
- asp.net(c#) static关键字用法小结+示例代码
- static用法小结
- static用法小结
- x:Static 和 StaticResource 标记扩展
- static用法小结
- static用法小结
- Java中static、final用法小结
- static用法小结
- 【C#基础】static 关键字用法小结
- static关键字用法小结【转帖】
- Java中static、final用法小结
- 从零开始学C++之对象的使用(三):static 与单例模式、auto_ptr与单例模式、const 用法小结、mutable修饰符
- Java中static、final用法小结
- static用法小结(转载)
- static关键字的用法小结
- Java中static、final用法小结
- static用法小结