Silverlight中的同步 [英] Synchronization in Silverlight

查看:72
本文介绍了Silverlight中的同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想同步两个文本框,这两个文本框位于silverlight的不同用户控件中,我想要的是,当我开始在一个文本框中编写内容时也应该出现在第二个文本框中。



绑定控件的问题,



Hi ,

I want to synchronize two textboxes which are in different user controls of silverlight , i want that , the moment i start writing something in one textbox it should also appear in second textbox.

Problem with binding controls,

public static readonly DependencyProperty InnerTextProperty = DependencyProperty.Register("InnerText",
    typeof(string), 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)
{
    CheckEmailExistence c = obj as CheckEmailExistence;
    //TextBox c = obj as TextBox;
    //TextBlock y = obj as TextBlock;
    if (c != null)
    {

        //c.Text = (string)e.NewValue;
        c.lblMsg.Content = (string)e.NewValue;
        //y.Text = (string)e.NewValue;
    }

}







等待回复...




Waiting for replies...

推荐答案

同样的问题在这里回答: StackOverflow论坛 [ ^ ]。



问候。
The same question was answer here: StackOverflow Forum[^].

Regards.


这篇关于Silverlight中的同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆