realesmedia
Topic Author
Posts: 85
Joined: 18 May 2016, 10:26

Data Binding StringFormat

26 May 2017, 17:14

XAML:
<Label x:Name="label" Content="my_value"/>
<TextBlock Text="{Binding Content, ElementName=label, StringFormat={}value is: {0}}"/>
My WPF project displays text "value is" before value correctly.
Noesis project displays only value without StringFormat property.
 
realesmedia
Topic Author
Posts: 85
Joined: 18 May 2016, 10:26

Re: Data Binding StringFormat

29 May 2017, 09:26

Any suggestions?
 
User avatar
sfernandez
Site Admin
Posts: 1912
Joined: 22 Dec 2011, 19:20

Re: Data Binding StringFormat

29 May 2017, 14:25

Sorry, but there is a bug with StringFormat as explained here: viewtopic.php?f=3&t=1091
Meanwhile you have to use 2 TextBlocks to accomplish that:
<Label x:Name="label" Content="my_value"/>
<StackPanel Orientation="Horizontal">
  <TextBlock Text="value is: "/>
  <TextBlock Text="{Binding Content, ElementName=label"/>
</StackPanel>

Who is online

Users browsing this forum: Bing [Bot] and 1 guest