示例#1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            //显示初始化提示框
            GuoKun.CustomControls.CustomMessageBox messageBox = new GuoKun.CustomControls.CustomMessageBox("系统正在初始化······");
            messageBox.Show();
            this.DispatcherUnhandledException          += App_DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            //加载系统样式
            ResourceDictionary defaultDictionary = new ResourceDictionary()
            {
                Source = new Uri("/GuoKun.Themes;component/Themes/Default.xaml", UriKind.RelativeOrAbsolute),
            };

            this.Resources.MergedDictionaries.Add(defaultDictionary);

            //系统初始化
            BootstrapperConfiguration     bootstrapperConfiguration = ConfigurationManager.GetSection("account/bootstrapper") as BootstrapperConfiguration;
            CustomMefBootstrapper <Shell> bootstrapper = new CustomMefBootstrapper <Shell>(bootstrapperConfiguration);

            bootstrapper.Run(true);

            _log = UnityContainerFactory.GetUnityContainer().Resolve <ILog>();

            messageBox.Close();
            Application.Current.MainWindow.Show();
        }
示例#2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            //显示初始化提示框
            GuoKun.CustomControls.CustomMessageBox messageBox = new GuoKun.CustomControls.CustomMessageBox("系统正在初始化······");
            messageBox.Show();
            this.DispatcherUnhandledException += App_DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            //加载系统样式
            ResourceDictionary defaultDictionary = new ResourceDictionary()
            {
                Source = new Uri("/GuoKun.Themes;component/Themes/Default.xaml", UriKind.RelativeOrAbsolute),
            };
            this.Resources.MergedDictionaries.Add(defaultDictionary);

            //系统初始化
            BootstrapperConfiguration bootstrapperConfiguration = ConfigurationManager.GetSection("account/bootstrapper") as BootstrapperConfiguration;
            CustomMefBootstrapper<Shell> bootstrapper = new CustomMefBootstrapper<Shell>(bootstrapperConfiguration);
            bootstrapper.Run(true);

            _log = UnityContainerFactory.GetUnityContainer().Resolve<ILog>();

            messageBox.Close();
            Application.Current.MainWindow.Show();
        }