このコードを wpf に移植するにはどうすればよいですか?
public void ChangeTextBox(string txt)
{
if (textBox1.InvokeRequired)
{
Invoke(new UpdateText(ChangeTextBox), new object[] { txt });
}
else
{
textBox1.Text += txt + "\r\n";
}
}