예제 #1
0
        private static void OnTextBoxNuevoMensajeChatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ChatUserControl controlChat = (ChatUserControl)d;

            if (e.OldValue != null)
            {
                TextBox oldText = (TextBox)e.NewValue;
                oldText.TextChanged -= new TextChangedEventHandler(controlChat.TextBoxNuevoMensaje_TextChanged);
            }

            TextBox newText = (TextBox)e.NewValue;

            newText.TextChanged += new TextChangedEventHandler(controlChat.TextBoxNuevoMensaje_TextChanged);
        }
예제 #2
0
        private static void OnBotonEnviarTextoChatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ChatUserControl controlChat = (ChatUserControl)d;

            if (e.OldValue != null)
            {
                Button oldButton = (Button)e.NewValue;
                oldButton.Click -= new RoutedEventHandler(controlChat.BotonEnviarTexto_Click);
            }

            Button newButton = (Button)e.NewValue;

            newButton.Click += new RoutedEventHandler(controlChat.BotonEnviarTexto_Click);
        }