views:

63

answers:

1

I've made two user controls A and B. Each of them has a TextBlock inside, and are places inside the root control (Page/RootVisual)

How do i bind the two "Text" properties, so that the text in B changes when the text in A changes(and not from B to A)

I cannot figure out the way to type this in XAML. What do i write as (x) in:

Text="{Binding ElementName=(x), Mode=OneWay, Path=Text}"

Said in another way: How do i reference an element property in a sibbling usercontrol?

A: 

I tried this and it works - text flows from A to B but not from B to A:

<TextBox x:Name="A"/>
<TextBox x:Name="B" Text="{Binding ElementName=A, Path=Text}"/>

Keep in mind that only works in Silverlight 3. Could you post some sample code?

James Cadd
I think you ignored my first line, saying that the <TextBox> controls each are going to be inside a <UserControl>. I want to do it this way to split the user interface into seperate .xaml files. In this example it mean I've got 3 .xaml files (page.xaml, user_control_a.xaml, user_control_b.xaml)I'll post some source code later.
MonkeyZinc