示例#1
0
 public App()
 {
     this.DispatcherUnhandledException += App_DispatcherUnhandledException;
     XamlDisplay.Init();
     this.Startup   += App_Startup;
     this.Activated += App_Activated;
 }
        protected override void OnStartup(StartupEventArgs e)
        {
            //This is an alternate way to initialize MaterialDesignInXAML if you don't use the MaterialDesignResourceDictionary in App.xaml
            //Color primaryColor = SwatchHelper.Lookup[MaterialDesignColor.DeepPurple];
            //Color accentColor = SwatchHelper.Lookup[MaterialDesignColor.Lime];
            //ITheme theme = Theme.Create(new MaterialDesignLightTheme(), primaryColor, accentColor);
            //Resources.SetTheme(theme);


            //Illustration of setting culture info fully in WPF:

            /*
             * Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
             * Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");
             * FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(
             *          XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
             */

            XamlDisplay.Init();

            // test setup for Persian culture settings

            /*System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fa-Ir");
             * System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fa-Ir");
             * FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(
             *          System.Windows.Markup.XmlLanguage.GetLanguage(System.Globalization.CultureInfo.CurrentCulture.IetfLanguageTag)));*/

            base.OnStartup(e);
        }
示例#3
0
 protected override void OnStartup(StartupEventArgs e)
 {
     XamlDisplay.Init();
     base.OnStartup(e);
     MainWindow = Kernel.Get <MainWindow>();
     MainWindow.Show();
 }
示例#4
0
 protected override void OnStartup(StartupEventArgs e)
 {
     log4net.Config.XmlConfigurator.Configure();
     Initialize(@"\Logs\logs.txt");
     log.Info("        =============  Started Logging  =============        ");
     XamlDisplay.Init();
     base.OnStartup(e);
 }
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            XamlDisplay.Init();
            ThemeManager.Current.ChangeTheme("Light");
            new GalleryBootstrapper().Run();
        }
示例#6
0
        public MainWindow()
        {
            InitializeComponent();
            XamlDisplay.Init();
            NavigationHelper.RegisterContentControl(this.content);
            NavigationHelper.NavigatedToView("用户登录");

            this.Loaded += MainWindow_Loaded;
        }
示例#7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            //UI线程未捕获异常处理事件
            this.DispatcherUnhandledException += new DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
            //Task线程内未捕获异常处理事件
            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
            //非UI线程未捕获异常处理事件
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            Logger.ExceptionDialog = new ExceptionDialog("RootDialog");
            XamlDisplay.Init();
            base.OnStartup(e);
        }
示例#8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            XamlDisplay.Init();
            //Illustration of setting culture info fully in WPF:

            /*
             * Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
             * Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");
             * FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(
             *          XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
             */

            base.OnStartup(e);
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            XamlDisplay.Init();
            base.OnStartup(e);

            //Add/Update brush used by Dragablz when the theme changes
            //Solution for https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/2349
            PaletteHelper helper = new PaletteHelper();

            if (helper.GetThemeManager() is { } themeManager)
            {
                themeManager.ThemeChanged += ThemeManager_ThemeChanged;
            }
        }
示例#10
0
        protected override void OnStartup(StartupEventArgs e)
        {
            XamlDisplay.Init();

            AccountSettingsStore.LoadFromFile("settings");
            Globals.AppState.LoginState.Username = AccountSettingsStore.Instance.LastUsername;
            Globals.UiDispatcher = Dispatcher;

            if (!string.IsNullOrEmpty(Globals.AppState.LoginState.Username))
            {
                Globals.AppState.LoginState.RememberLogin = true;
            }

            base.OnStartup(e);
        }
示例#11
0
        protected override void OnStartup(StartupEventArgs e)
        {
            XamlDisplay.Init();
            //Illustration of setting culture info fully in WPF:

            /*
             * Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
             * Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");
             * FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(
             *          XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
             */

            // test setup for Persian culture settings

            /*System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fa-Ir");
             * System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fa-Ir");
             * FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(
             *          System.Windows.Markup.XmlLanguage.GetLanguage(System.Globalization.CultureInfo.CurrentCulture.IetfLanguageTag)));*/

            base.OnStartup(e);
        }
示例#12
0
 protected override void OnStartup(StartupEventArgs e)
 {
     XamlDisplay.Init();
     base.OnStartup(e);
 }
示例#13
0
 public App()
 {
     XamlDisplay.Init();
 }
示例#14
0
 private void ConfigureXamlDisplay()
 {
     XamlDisplay.Init(GetType().Assembly);
 }