/// <summary> /// Should be called from OnActivated and OnLaunched /// </summary> private void RegisterExceptionHandlingSynchronizationContext() { ExceptionHandlingSynchronizationContext .Register() .UnhandledException += SynchronizationContext_UnhandledException; }
private void EnsureSyncContext() { var exceptionHandlingSynchronizationContext = ExceptionHandlingSynchronizationContext.Register(); exceptionHandlingSynchronizationContext.UnhandledException += OnSynchronizationContextUnhandledException; }