1
我想格式化一個綁定到某個值的文本塊,在實際值之前顯示「R」,這是否可能,是因爲我無法直接更改該值?Windows Phone 8 xaml文本塊綁定格式
謝謝
<ListBox x:Name="lstbundleListbox"
Foreground="White"
Height="320"
HorizontalAlignment="Center">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment"
Value="Center" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding name}"
TextWrapping="Wrap"
HorizontalAlignment="Center" />
<TextBlock Text="{Binding cost}"
TextWrapping="Wrap"
HorizontalAlignment="Center" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ListBox>
所以我基本上要在文本塊顯示R(成本)
完美!謝謝 – Bohrend