Silverlight中的同步

Silverlight中的同步,silverlight,synchronization,Silverlight,Synchronization,我在Silverlight应用程序中有两个包含文本框(1)的用户控件,当我开始在其中一个文本框中写入时,如何同步这些文本框 在每个控件中创建一个更改文本框值的控件,然后将控件绑定到另一个控件的值 范例 public static readonly DependencyProperty InnerTextProperty= DependencyProperty.Register( "InnerText", typeof(string

我在Silverlight应用程序中有两个包含文本框(1)的用户控件,当我开始在其中一个文本框中写入时,如何同步这些文本框

在每个控件中创建一个更改文本框值的控件,然后将控件绑定到另一个控件的值

范例

           public static readonly DependencyProperty InnerTextProperty= 
                 DependencyProperty.Register(
    "InnerText", typeof(string),
        new PropertyMetadata(false, OnTextInput) );
public bool InnerText
{
    get { return (bool)GetValue(InnerTextProperty); }
    set { SetValue(InnerTextProperty, value); }
}

private static void OnTextInput(DependencyObject obj, DependencyPropertyChangedEventArgs e)
{
    YourControl c = obj as YourControl
    if(c != null)
    {
        c._innerTextBox.Text = e.Value;
    }

}

你想实现什么,一个更新另一个?或者它们有相同的内容?它们应该有相同的内容。:谢谢回复,但是如果两个控件位于不同的用户控件中,请告诉我如何创建依赖项属性?