<TextBlock Text="{Binding Path=Duration,StringFormat=Log Duration (± minutes): {0:#}}" />
label tooltip无效,TextBlock,TextBox有效。
如果{0}之前有字符串,则不需要加{},StringFormat=单价:{0}
否则需加上{} ,比如 StringFormat={}{0}
博客介绍了WPF中相关控件的使用情况,如TextBlock的文本绑定及StringFormat的使用规则。指出label tooltip无效,TextBlock和TextBox有效,还说明了{0}前有无字符串时StringFormat的不同写法。
<TextBlock Text="{Binding Path=Duration,StringFormat=Log Duration (± minutes): {0:#}}" />
label tooltip无效,TextBlock,TextBox有效。
如果{0}之前有字符串,则不需要加{},StringFormat=单价:{0}
否则需加上{} ,比如 StringFormat={}{0}
1261

被折叠的 条评论
为什么被折叠?