public SettingPage()
 {
     this.InitializeComponent();
     this.navigationHelper = new NavigationHelper(this);
     settingService = SettingService.GetInstance();
     userService = UserService.GetInstance();
     colorService = ColorService.GetInstance();
     switchesRespose = new GetSettingSwitchesRespose();
     autoUpdateTimeRepose = new GetSettingAutoUpdateTimeRepose();
     userRespose = new GetUserRespose();
     colorResponse = new GetColorRespose();
 }
Beispiel #2
0
        /// <summary>
        /// 初始化单一实例应用程序对象。这是执行的创作代码的第一行,
        /// 逻辑上等同于 main() 或 WinMain()。
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += this.OnSuspending;

            userService = UserService.GetInstance();
            settingService = SettingService.GetInstance();

            userRespose = new GetUserRespose();
            settingAutoUpdateTimeRepose = new GetSettingAutoUpdateTimeRepose();

        }
Beispiel #3
0
        public GetSettingAutoUpdateTimeRepose GetSettingAutoUpdateTime()
        {
            GetSettingAutoUpdateTimeRepose respose = new GetSettingAutoUpdateTimeRepose();
            List<Model.AutoUpdateTime> list = new List<Model.AutoUpdateTime>();
            list.Add(new Model.AutoUpdateTime() { Id = 1, Content = "1小时", Time=60 });
            list.Add(new Model.AutoUpdateTime() { Id = 2, Content = "2小时", Time = 120 });
            list.Add(new Model.AutoUpdateTime() { Id = 3, Content = "4小时", Time = 240 });
            list.Add(new Model.AutoUpdateTime() { Id = 4, Content = "6小时", Time = 360 });
            list.Add(new Model.AutoUpdateTime() { Id = 5, Content = "24小时", Time = 1440 });

            respose.AutoUpdateTimes = list;
            return respose;
        }
        public SettingPage()
        {
            this.InitializeComponent();

            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;

            settingService = SettingService.GetInstance();
            userService = UserService.GetInstance();
            switchesRespose = new GetSettingSwitchesRespose();
            autoUpdateTimeRepose = new GetSettingAutoUpdateTimeRepose();
            userRespose = new GetUserRespose();

        }
Beispiel #5
0
        /// <summary>
        /// 初始化单一实例应用程序对象。这是执行的创作代码的第一行,
        /// 逻辑上等同于 main() 或 WinMain()。
        /// </summary>
        public App()
        {
            this.RequestedTheme = ApplicationTheme.Dark;
            this.InitializeComponent();
            this.Suspending += this.OnSuspending;

            userService = UserService.GetInstance();
            settingService = SettingService.GetInstance();
            colorService = ColorService.GetInstance();
            userRespose = new GetUserRespose();
            settingAutoUpdateTimeRepose = new GetSettingAutoUpdateTimeRepose();

            HardwareButtons.BackPressed += HardwareButtons_BackPressed;

        }
        public PivotPage()
        {
            this.InitializeComponent();

            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;

            userService = UserService.GetInstance();
            weatherService = WeatherService.GetInstance();
            settingService = SettingService.GetInstance();
            userRespose = new GetUserRespose();
            userCityRespose = new GetUserCityRespose();
            weatherRespose = new GetWeatherRespose();
            weatherTypeRespose = new GetWeatherTypeRespose();
            settingAutoUpdateTimeRepose = new GetSettingAutoUpdateTimeRepose();
        }
Beispiel #7
0
        public MainPage()
        {
            this.navigationHelper = new NavigationHelper(this);
            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;

            userService = UserService.GetInstance();
            weatherService = WeatherService.GetInstance();
            settingService = SettingService.GetInstance();
            colorService = ColorService.GetInstance();

            userRespose = new GetUserRespose();
            userCityRespose = new GetUserCityRespose();
            weatherRespose = new GetWeatherRespose();
            weatherTypeRespose = new GetWeatherTypeRespose();
            settingAutoUpdateTimeRepose = new GetSettingAutoUpdateTimeRepose();
            colorResponse = new GetColorRespose();
            homePageModel = new HomePageModel();


            this.InitializeComponent();
            Loaded += MainPage_Loaded;
        }
        private async Task LoadData()
        {
            switchesRespose = settingService.GetSettingSwitches();
            autoUpdateTimeRepose = settingService.GetSettingAutoUpdateTime();
            userRespose = await userService.GetUserAsync();

            ViewModel.AutoUpdateSettingPage autoUpdateSettingPage = new ViewModel.AutoUpdateSettingPage()
            {
                Switches = switchesRespose.Switches,
                AutoUpdateTimes = autoUpdateTimeRepose.AutoUpdateTimes
            };
            ViewModel.GeneralSettingPage generalSettingPage = new ViewModel.GeneralSettingPage()
            {
                Switches = switchesRespose.Switches
            };
            ViewModel.SettingPage settingPage = new ViewModel.SettingPage()
            {
                AutoUpdateSettingPage = autoUpdateSettingPage,
                GeneralSettingPage = generalSettingPage,
                UserConfig = userRespose.UserConfig

            };
            colorResponse = await colorService.GetColorAsync();
            this.LVMood.DataContext = colorResponse.UserColors;
            this.LayoutRoot.DataContext = null;
            this.LayoutRoot.DataContext = settingPage;
        }
        private async void LoadData()
        {
            switchesRespose = settingService.GetSettingSwitches();
            autoUpdateTimeRepose = settingService.GetSettingAutoUpdateTime();
            userRespose = await userService.GetUserAsync();

            ViewModel.AutoUpdateSettingPage autoUpdateSettingPage = new ViewModel.AutoUpdateSettingPage()
            {
                Switches = switchesRespose.Switches,
                AutoUpdateTimes = autoUpdateTimeRepose.AutoUpdateTimes
            };
            ViewModel.GeneralSettingPage generalSettingPage = new ViewModel.GeneralSettingPage()
            {
                Switches = switchesRespose.Switches
            };
            ViewModel.SettingPage settingPage = new ViewModel.SettingPage()
            {
                AutoUpdateSettingPage = autoUpdateSettingPage,
                GeneralSettingPage = generalSettingPage,
                UserConfig = userRespose.UserConfig

            };
            LayoutRoot.DataContext = settingPage;
        }
Beispiel #10
0
        /// <summary>
        /// 创建后台任务
        /// </summary>
        /// <param name="taskName"></param>
        /// <param name="taskEntryPoint"></param>
        private async void CreateTask(string taskName, string taskEntryPoint)
        {
            userRespose = await userService.GetUserAsync();

            BackgroundTaskExecute backgroundTaskExecute = new BackgroundTaskExecute();
            if (BackgroundTaskHelper.IsExist(taskName))
            {
                backgroundTaskExecute.Execute(taskName);
            }
            else
            {
                settingAutoUpdateTimeRepose = settingService.GetSettingAutoUpdateTime();
                int time = settingAutoUpdateTimeRepose.AutoUpdateTimes.FirstOrDefault(x => x.Id == userRespose.UserConfig.AutoUpdateTime).Time;
                backgroundTaskExecute.Create(taskName, taskEntryPoint, time, null);
            }
        }