wpf:

    1. Lora.RecieveAll = (loraframe) =>
    2. {
    3. ThreadPool.QueueUserWorkItem(delegate
    4. {
    5. SynchronizationContext.SetSynchronizationContext(new
    6. DispatcherSynchronizationContext(System.Windows.Application.Current.Dispatcher));
    7. SynchronizationContext.Current.Post(pl =>
    8. {
    9. ObservableC.Add(loraframe);
    10. }, null);
    11. });
    12. };

    uwp:

    1. Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
    2. () =>
    3. {
    4. // Your UI update code goes here!
    5. }
    6. );

    2.winform中使用this.invoke()
    wpf中使用 this.dispatcher.invoke( (action)delegate {改变ui})