ForecastView.xaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  4. x:Class="MyWeather.View.ForecastView"
  5. Title="Forecast">
  6. <ListView ItemsSource="{Binding Forecast.Items}"
  7. HasUnevenRows="True"
  8. CachingStrategy="RecycleElement"
  9. IsPullToRefreshEnabled="True"
  10. RowHeight="66"
  11. RefreshCommand="{Binding GetWeatherCommand}"
  12. IsRefreshing="{Binding IsBusy, Mode=OneWay}"
  13. x:Name="ListViewWeather">
  14. <ListView.SeparatorColor>
  15. <OnPlatform x:TypeArguments="Color" iOS="Transparent"/>
  16. </ListView.SeparatorColor>
  17. <ListView.ItemTemplate>
  18. <DataTemplate>
  19. <ViewCell>
  20. <StackLayout Orientation="Horizontal" Padding="10,0,0,0">
  21. <Image HeightRequest="44"
  22. WidthRequest="44"
  23. Source="{Binding DisplayIcon}"/>
  24. <StackLayout Padding="10" Spacing="5">
  25. <Label Text="{Binding DisplayTemp}"
  26. TextColor="#3498db"
  27. Style="{DynamicResource ListItemTextStyle}"/>
  28. <Label Text="{Binding DisplayDate}"
  29. Style="{DynamicResource ListItemDetailTextStyle}"/>
  30. </StackLayout>
  31. </StackLayout>
  32. </ViewCell>
  33. </DataTemplate>
  34. </ListView.ItemTemplate>
  35. </ListView>
  36. </ContentPage>
  37. <!---->