示例#1
0
        public MainPage()
        {
            this.InitializeComponent();
            SettingManager = SettingManager.Current;
            CacheManager = CacheManager.Current;
            LoadCurrentUserInfo();
            //设置Dispatcher,使得更新操作可以异步进行
            SettingManager.SetDispatcher(this.Dispatcher);
            InitFrame();
            InitNavigationService();
            AuthenticationService.SetLoginPage(typeof(LoginPage));
            //导航及界面主次Frame切换等都由NavigationService进行控制

            SystemNavigationManager.GetForCurrentView().BackRequested += BackRequest;
            //若要全屏则隐藏顶部状态栏
            if (App.NavigationService.IsMobile && SettingManager.IsFullWindows)
            {
                if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent(typeof(StatusBar).ToString()))
                {
                    StatusBar statusBar = StatusBar.GetForCurrentView();
                    statusBar.BackgroundColor = Colors.OrangeRed;
                    statusBar.BackgroundOpacity = 1;
                }
                //statusBar.HideAsync();
            }
        }
示例#2
0
 public SettingViewModel()
 {
     SettingManager = SettingManager.Current;
     this.IsDarkModel = SettingManager.Theme == ElementTheme.Dark;
     this.IsNoImagesModel = SettingManager.IsNoImagesMode;
     this.IsFullWindows = SettingManager.IsFullWindows;
     this.FontSize = (int)SettingManager.FontSize;
 }