예제 #1
0
        public async Task <GetCityRespose> GetCityAsync()
        {
            GetCityRespose respose = new GetCityRespose();

            respose = await Weather.Utils.JsonSerializeHelper.JsonDeSerializeForFileByInstalledLocationAsync <GetCityRespose>("Data\\Cities.json").ConfigureAwait(false);

            return(respose);
        }
예제 #2
0
        public AddCityPage()
        {
            this.InitializeComponent();

            this.navigationHelper    = new NavigationHelper(this);
            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;


            cityService      = CityService.GetInstance();
            userService      = UserService.GetInstance();
            resposeCities    = new GetCityRespose();
            resposeHotCities = new GetHotCityRespose();
            resposeUserCity  = new GetUserCityRespose();
        }
예제 #3
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.navigationHelper.OnNavigatedTo(e);

            // 获取用户城市数据
            resposeUserCity = await userService.GetUserCityAsync();

            // 获取城市
            resposeCities = await cityService.GetCityAsync();

            // 获取人们城市
            resposeHotCities = await cityService.GetHotCityAsync();;

            // 数据绑定
            page = new ViewModel.SelectCityPage();

            page.Cities = resposeCities.Cities;

            page.HotCities = resposeHotCities.Cities;

            LayoutRoot.DataContext = page;
        }