如果我有标签:
<Label Content="{StaticResource Foo}" />
有没有办法在 xaml 中附加 *?
我正在寻找类似的东西:
<Label Content="{StaticResource Foo, stringformat={0}*" />
我从资源字典中放置控件的内容,因为该应用程序支持多种语言。我想知道是否可以在 xaml 中附加 *,这样我就不必创建一个事件,然后在该事件触发时附加它。
编辑:
在资源字典中,我有:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<system:String x:Key="Foo">Name</system:String>
</ResourceDictionary>
在我的窗口中,我有:(我合并了最后一个字典)
<Label Content="{StaticResource 'Foo'}" />
并显示名称
我希望标签显示名称* 而不仅仅是名称
也许用一种风格来实现这一点是可能的。