locked
Binding custom dependency property in code behing RRS feed

  • Question

  • Normal to do binding in code behind I do 


    tb.SetBinding(TextBlock.FontSizeProperty, b);

    I have a user control with DependencyProperty UserControlProperty

    How do I replace the
    TextBlock.FontSizeProperty with my UserControlProperty?
    Thursday, December 2, 2010 6:16 PM

Answers

  • Since a custom dependency property is a static property of the usercontrol class you can simply use <UserControlClassName>.<DependencyProperty>

    Thursday, December 2, 2010 6:34 PM

All replies

  • Since a custom dependency property is a static property of the usercontrol class you can simply use <UserControlClassName>.<DependencyProperty>

    Thursday, December 2, 2010 6:34 PM
  • do you mean something like myUserContro.MyDependencyProperty? I tried but MyDependencyProperty is not available for the control, it doesn't show up in my intelesence once I put "Static" in front of the dp

    Thursday, December 2, 2010 6:45 PM