You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using WeatherClient.Models;
|
|
|
|
|
using WeatherClient.ViewModels;
|
|
|
|
|
|
|
|
|
|
namespace WeatherClient
|
|
|
|
|
{
|
|
|
|
|
public partial class MainPage : ContentPage
|
|
|
|
|
{
|
|
|
|
|
private WeatherViewModel _context;
|
|
|
|
|
|
|
|
|
|
public MainPage()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async void btnRefresh_Clicked(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
btnRefresh.IsEnabled = false;
|
|
|
|
|
actIsBusy.IsRunning = true;
|
|
|
|
|
|
|
|
|
|
WeatherData weatherData = await Services.WeatherServer.GetWeather(txtPostalCode.Text);
|
|
|
|
|
_context = new WeatherViewModel() { WeatherData = weatherData };
|
|
|
|
|
BindingContext = _context;
|
|
|
|
|
|
|
|
|
|
btnRefresh.IsEnabled = true;
|
|
|
|
|
actIsBusy.IsRunning = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|