I can't find the right NuGet packet to install the invoke method. I have a wpf GUI and I have a separate thread that needs to update items in a listBox. I need the "Invoke" method in order to change the items in the listBox.
public void displayPlayers(string players)
{
//spliting all the names.
string[] names = players.Split(", ".ToCharArray());
//Displaying the names.
foreach (string name in names)
this.Invoke((MethodInvoker)(() => playersListBox.Items.Add(name)));
}