Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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,

C#
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...
Posted
Updated 21-Feb-13 6:13am
v2
Comments
Sandeep Mewara 21-Feb-13 10:22am    
And what happened when you tried to do it? Where exactly you got stuck?
Ariana Bond 21-Feb-13 11:42am    
when i am trying to bind them , page is not loading.There is some sort of problem while binding controls.
Sandeep Mewara 21-Feb-13 11:47am    
Then you should update the question with your implementation such that someone can point the mistake.

1 solution

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

Regards.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900