public class App : Application
{
ListView lv;
public App()
{
lv = new ListView();
// The root page of your application
MainPage = new ContentPage
{
Content = new StackLayout
{
VerticalOptions = LayoutOptions.FillAndExpand,
Children = {
lv
}
}
};
MainPage.Title = "Weather";
if (Device.OS == TargetPlatform.iOS)
{
MainPage.Padding = new Thickness (0, 35, 0, 0);
}
DisplayData();
}
async void DisplayData()
{
var wsa = new Data();
var weather = await wsa.GetData("Knoxville, TN");
var cellTemplate = new DataTemplate(typeof(TemperatureCell));
lv.ItemTemplate = cellTemplate;
lv.ItemsSource = weather.list;
}
protected override void OnStart()
{ }
protected override void OnSleep()
{ }
protected override void OnResume()
{ }
}
{
ListView lv;
public App()
{
lv = new ListView();
// The root page of your application
MainPage = new ContentPage
{
Content = new StackLayout
{
VerticalOptions = LayoutOptions.FillAndExpand,
Children = {
lv
}
}
};
MainPage.Title = "Weather";
if (Device.OS == TargetPlatform.iOS)
{
MainPage.Padding = new Thickness (0, 35, 0, 0);
}
DisplayData();
}
async void DisplayData()
{
var wsa = new Data();
var weather = await wsa.GetData("Knoxville, TN");
var cellTemplate = new DataTemplate(typeof(TemperatureCell));
lv.ItemTemplate = cellTemplate;
lv.ItemsSource = weather.list;
}
protected override void OnStart()
{ }
protected override void OnSleep()
{ }
protected override void OnResume()
{ }
}