Пример #1
0
        public App()
        {
            UIErrorOverdoor.SetBehavior(new ErrorOverdoorBehavior());
            this.Dispatcher.UnhandledException += OnDispatcherUnhandledException;
            IContainerWrapper ioc = new UnityContainerWrapper();

            IoC.InitializeWith(ioc);
            Transactions.Service = IoC.Resolve <TransactionService>();

            foreach (var uiAssistant in IoC.ResolveAll <IUISettingsTypeAssistant>())
            {
                UISettings.RegisterTypeAssistant(uiAssistant);
            }

            FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

            TaskScheduler.UnobservedTaskException += (object sender, UnobservedTaskExceptionEventArgs e) =>
            {
                e.SetObserved();
                UIErrorOverdoor.Show(e.Exception);
            };
        }
Пример #2
0
 void ShowUnhandeledException(System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 {
     e.Handled = true;
     UIErrorOverdoor.Show(e.Exception);
 }