private void ModelOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs) { _dispatchService.Invoke(() => OnPropertyChanged(propertyChangedEventArgs.PropertyName ), DispatcherPriority.Background); _dispatchService.DoEvents(); }
/// <summary> /// Startup / Initialize the application /// </summary> public void Startup() { try { _startupActions.OrderBy(x => x.Priority).ToList().ForEach( x => { try { x.ProcessStartupAction(); } catch (Exception e) { _logger.Log( LogLevel.Fatal, string.Format("Exception thrown from startup action {0}", x.Priority.ToString()), e); throw; } }); _eventAggregator.GetEvent <ApplicationStartedEvent>().Publish(null); } catch (Exception e) { _logger.Log(LogLevel.Error, e); if (Application.Current != null) { // Must be done on the dispatcher thread var shutdownAction = new Action(() => Application.Current.Shutdown(-1)); if (_dispatchService.CheckAccess()) { shutdownAction.Invoke(); } else { _dispatchService.Invoke(shutdownAction); } } _applicationService.Shutdown(); } }