0

I have a WPF label which is bound to a property in the view model:

  <Label x:Name="Results" Content="{Binding Matching, String.Format='Results: {0}'}">

I am trying to concatenate the string with the number returned by the property, for example, if Matching returns 5 I would like to display:

Results: 5

but it is not working.

2
  • 5
    Possible duplicate of WPF StringFormat on Label Content Commented Jul 27, 2017 at 15:31
  • Use a TextBlock with Run, <TextBlock><Run Text="Results: "/><Run Text="{Binding Matching}"/></TextBlock> Commented Jul 28, 2017 at 9:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.