Sometimes you need to affect or change a property of one control based on the input of another control at runtime. A very simple example would be something like changing the Content property of a button by typing text into a Textbox. This is achieved by using a markup extension to bind the two controls together.

Drag both a button and a textbox onto your design surface. Instead of hardcoding the Content property in the markup for the button, here’s the syntax you would use:

Content="{Binding ElementName=TextBox1, Path=Text}"

Using the ‘Binding’ object, the ‘ElementName’ is the control which will affect the button. In this case, it is ‘TextBox1′, which is the textbox’s ‘Name’ property. Also, the ‘Path’ here represents the property of the designated textbox which will affect the button’s ‘Content’ property. The curly braces tell the application that this property will be set at runtime and not at design time.

Now, when you run your SilverLight application, anything you type in your textbox will be instantly reflected in your button.