private void ClientChatTextBoxInput_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) { MainClientWorker.SendMessage(ClientChatTextBoxInput.Text); ClientChatTextBoxInput.Text = null; } }
private void GeneralChatInputTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { string MessageToSend = GeneralChatInputTextBox.Text; Task.Run(() => MainClientWorker.SendMessage(MessageToSend)); GeneralChatInputTextBox.Text = ""; } }