I'm getting the error
'socketServer.Form1' does not contain a definition for 'Dispatcher' and no extension method 'Dispatcher' accepting a first argument of type 'socketServer.Form1' could be found
From
private void tbAux_SelectionChanged(object sender, EventArgs e)
{
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate()
{
textBox.Text = tbAux.Text;
}
);
}
According to the documentation, the Dispatcher
class is part of the namespace System.Windows.Threading
, which I'm using.
Am I missing another reference?
In case it's relevant, I added this after receiving an error that "cross-thread operation was not valid" using a server/client socket.