Beispiel #1
0
 public GetSettingSwitchesRespose GetSettingSwitches()
 {
     GetSettingSwitchesRespose respose = new GetSettingSwitchesRespose();
     List<Model.Switchable> list = new List<Model.Switchable>();
     list.Add(new Model.Switchable() { Id = 0, Content = "关" });
     list.Add(new Model.Switchable() { Id = 1, Content = "开" });
     respose.Switches = list;
     return respose;
 }
 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();
 }
        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();

        }
        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;
        }