Ray Lu
Ray Lu

Reputation: 26648

Silverlight: How to bind to the other control itself; Not the control's property

I have a user control which got a property pointing to other control say textbox.

e.g. in XAML

<MyControl TheTextBox="{Binding ????}" />


<TextBox x:Name="MyTextBox" />

How to set TheTextBox to be MyTextBox in XAML?

Thanks

Upvotes: 0

Views: 517

Answers (1)

Austin Lamb
Austin Lamb

Reputation: 3116

Try

<MyControl TheTextBox="{Binding ElementName=MyTextBox}"/>

Upvotes: 4

Related Questions