You should be able to use the
Dispatcher[
^] property on that. Use the Disptachers
CheckAccess()
method the check how to access the control. (note CheckAccess does not appear in intellisense.)
Here's a sample where the backgroundworker thread calls the SetMsg function to update the label control:
private void SetMsg(string txt, string fulltxt){
if(lbl_info.Dispatcher.CheckAccess()){
lbl_info.Content = txt;
fullinfomessage = txt + "\r\n" + fulltxt;
}
else{
lbl_info.Dispatcher.Invoke(new UpdateTxt(SetMsg), new object [] { txt, fulltxt });
}
}
Hope this helps.