How to update only a property in an observable collection from thread other than dispatcher thread in WPF MVVM?

前端 未结 3 500
傲寒
傲寒 2021-01-24 12:30

I am having a class named Employee. I need to update only the property Status from thread other than current dispatcher thread:

         


        
3条回答
  •  走了就别回头了
    2021-01-24 13:01

    Try Application.Current.Dispatcher.BeginInvoke(() => /* update value */);

    https://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcher.begininvoke(v=vs.110).aspx

    Edit: see this answer

提交回复
热议问题