SynchronizationContext.Current is null on resolving with Unity in WPF

后端 未结 3 542
耶瑟儿~
耶瑟儿~ 2021-01-06 00:50

I have a WPF Code which looks something like this.

public class AlphaProductesVM : BaseModel
{
    private  ObservableCollection

        
3条回答
  •  伪装坚强ぢ
    2021-01-06 01:36

    Although there is an implementation of SynchronizationContextfor WPF it is not recommended for use. WPF has the Dispatcher to build responsive applications.

    In addition SynchronizationContext.Current only has a value if you are on the UI thread. If your logic runs in a background thread Current will always be null.

提交回复
热议问题