private void handleChatInput() { if (!String.IsNullOrEmpty(ChatTextInput.Text)) { //todo: put this back in when networking works again, else will crash cause I'm passing in a null peer peer.SendChat(ChatTextInput.Text); string textToAppend = humanPlayerName + ": " + ChatTextInput.Text; Paragraph newParagraph = new Paragraph(new Run(textToAppend)) { LineHeight = 1, Foreground = Brushes.Cyan }; ChatRichTextBoxFlowDocument.Blocks.Add(newParagraph); ChatRichTextBox.ScrollToEnd(); ChatTextInput.Clear(); } }
public void UnFocusEntry() { ChatTextInput?.Unfocus(); }
private void ChatboxUserControl1_Loaded(object sender, RoutedEventArgs e) { ChatTextInput.Focus(); }