I have a separate thread that listens for data. And on receiving some data it needs to access one of the windows in the app and set some fields for that window.
Right now when I use this it throws an exception(saying this threads cannot access as Windows1 is owned by other thread):
foreach (Window w in App.Current.Windows)
{
if (w.Name == "WindowIamInterested")
{
//w.SetField set some fields in the window and
//and do w.Show() or w.Activate() to show the window to user
}
}
The above code runs in a separate thread and not the main thread. Is there a way I can access and modify the window.