惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
J
Java Code Geeks
IT之家
IT之家
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
P
Proofpoint News Feed
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
B
Blog
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
博客园 - 聂微东
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
U
Unit 42
aimingoo的专栏
aimingoo的专栏

博客园 - kings

项目团队成长日志--聆听客户声音,沟通无所不在 TOAD使用筆記 使电脑鼠标右键相应快的办法 非常好用的对日面试资料(转) IT技術者日本語面接(ぎじゅつしゃにほんごめんせつ)によく出(で)る100質問(しつもん) 获取应用程序路径 再议 构造方法(转自Q.yuhen) 基元类型、值类型和引用类型(转自Q.yuhen) C# 2.0 - 泛型(Generics)(转自Q.yuhen) new 和 override 的区别(转自Q.yuhen) “多态”一个需要注意的问题(转自Q.yuhen) C# 方法参数 ref 详述(转自Q.yuhen) 浅析Family Show 2.0的动态换肤实现(转tonyqus) 浅析Family Show 2.0的子窗体实现(转tonyqus) webservice 遇到的小问题 泛型集合类型,赋予集合业务意义,增强集合的抽象使用(转-lizhe1985) When I tab into a toolbar in WPF I can't tab out again? What can I do to change this tab behaviour? Windows Presentation Foundation(WPF)中的数据绑定(使用XmlDataProvider作控件绑定之二:使用外部URL的XML文件)(转-大可山) Windows Presentation Foundation(WPF)中的数据绑定(使用XmlDataProvider作控件绑定)(转-大可山)
WPF_Markup的几种写法
kings · 2007-09-03 · via 博客园 - kings

1. The StackPanel or child elements of the StackPanel can make use of these resources in one of two ways, both involving the StaticResource markup extension. The first Button accesses the resource using property element syntax for FontSize with an element of StaticResource and an attribute of ResourceKey to indicate the key of the item:

<Button.FontSize>
<StaticResource ResourceKey="fontsizeLarge" />
</Button.FontSize>

The more common syntax is shown for the second Button. The FontSize attribute is set to a string with the words StaticResource and the key name all enclosed in curly brackets:

FontSize="{StaticResource fontsizeSmall}"

2. Let's experiment a bit with the BindLabelToScrollBar.xaml file. Although the terms source and target seem to imply that changes in the source element (in this case, the ScrollBar) precipitate changes in the target element (the Label), that's only one of four possible binding modes. You specify the mode you want by using the Mode property and members of the BindingMode enumeration. This is the default:

Content="{Binding ElementName=scroll, Path=Value, Mode=OneWay}"

Notice that the setting of the Mode property is separated from the Path property setting by another comma, and that no quotation marks appear around the BindingMode enumeration member OneWay. If you prefer the property element syntax, you add it to the attributes in the Binding element:

<Label.Content>
<Binding ElementName="scroll" Path="Value" Mode="OneWay" />
</Label.Content>