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