How would one achieve mixing bound values with constant text in a WPF bound control?
For example, say I have a form displaying orders, and I want a label that displays text like ‘Order ID 1234’.
I’ve tried things like:
text='Order ID {Binding ....}'
Is this achievable, or do I have to do something like having more than one label in a flow control?
If you’re using 3.5 SP1, you can use the
StringFormatproperty on the binding:Otherwise, use a converter:
With
StringFormatConverterbeing anIValueConverter:That’ll do the trick.
[Edit : Change the
Textproperty toContent]