예제 #1
0
        public App()
        {
            this.InitializeComponent();
            bool isDisableScale = AppTool.GetBoolSetting(Settings.DisableXboxScale);

            if (SystemInformation.DeviceFamily == "Windows.Xbox" && isDisableScale)
            {
                Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.UseCoreWindow);
                Windows.UI.ViewManagement.ApplicationViewScaling.TrySetDisableLayoutScaling(true);
            }
            CustomXamlResourceLoader.Current = new CustomResourceLoader();
            this.Suspending    += OnSuspending;
            UnhandledException += OnUnhandleException;
            EnteredBackground  += App_EnteredBackground;
            LeavingBackground  += App_LeavingBackground;
            App.AppViewModel    = new AppViewModel();
            App.BiliViewModel   = new BiliViewModel();
            bool isThemeWithSystem = AppTool.GetBoolSetting(Settings.IsThemeWithSystem);

            _isTabletMode = AppTool.GetLocalSetting(Settings.DisplayMode, "") == "Tablet";
            if (!isThemeWithSystem)
            {
                string theme = AppTool.GetLocalSetting(Settings.Theme, "Light");
                RequestedTheme = theme == "Light" ? ApplicationTheme.Light : ApplicationTheme.Dark;
            }
        }
예제 #2
0
        public App()
        {
            this.InitializeComponent();

            CustomXamlResourceLoader.Current = new CustomResourceLoader();
            this.Suspending    += OnSuspending;
            UnhandledException += OnUnhandleException;
            EnteredBackground  += App_EnteredBackground;
            LeavingBackground  += App_LeavingBackground;
            App.AppViewModel    = new AppViewModel();
            App.BiliViewModel   = new BiliViewModel();
            bool isThemeWithSystem = AppTool.GetBoolSetting(Settings.IsThemeWithSystem);

            _isTabletMode = AppTool.GetLocalSetting(Settings.DisplayMode, "") == "Tablet";
            if (!isThemeWithSystem)
            {
                string theme = AppTool.GetLocalSetting(Settings.Theme, "Light");
                RequestedTheme = theme == "Light" ? ApplicationTheme.Light : ApplicationTheme.Dark;
            }
        }