locked
How to make the custom textblock bindable?

Answers

  • In the control's style, you set the text to a Binding:

    <TextBlock Text="{Binding Text}" />
    Then create a DependencyProperty called 'Text' of type 'String'. Just use the 'propdp' code snippet in Visual Studio for this. Now the Text is bindable, just like the Blink property of the example.

    Thursday, July 17, 2014 8:22 AM

All replies

  • In the control's style, you set the text to a Binding:

    <TextBlock Text="{Binding Text}" />
    Then create a DependencyProperty called 'Text' of type 'String'. Just use the 'propdp' code snippet in Visual Studio for this. Now the Text is bindable, just like the Blink property of the example.

    Thursday, July 17, 2014 8:22 AM
  • Thanks krols for your timely help.. Great guns!! Thanks again.
    Friday, July 18, 2014 5:51 AM