相关疑难解决方法(0)

Windows Phone 8.1 XAML StringFormat

我试图显示一些文本以及绑定数据,例如,我有代码:

<TextBlock Text="{Binding Shorthand}"  Style="{ThemeResource ListViewItemTextBlockStyle}" />
Run Code Online (Sandbox Code Playgroud)

我想在'速记'之前添加一些文本,从我读过的内容可以通过使用StringFormat作为Binding的属性来实现,这有点类似于:

<TextBlock Text="{Binding Path=Shorthand, StringFormat={0} text I want to add}"  Style="{ThemeResource ListViewItemTextBlockStyle}" />
Run Code Online (Sandbox Code Playgroud)

然而,这似乎不起作用,这是不是在8.1中做事的方式?

c# xaml windows-phone-8.1

15
推荐指数
2
解决办法
7914
查看次数

标签 统计

c# ×1

windows-phone-8.1 ×1

xaml ×1