Add app refresh
This commit is contained in:
@@ -11,13 +11,15 @@
|
||||
<ContentPage.Content>
|
||||
<AbsoluteLayout>
|
||||
<!--List-->
|
||||
<ListView AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
|
||||
<ListView x:Name="List"
|
||||
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
|
||||
AbsoluteLayout.LayoutFlags="All"
|
||||
ItemsSource="{Binding Plants}"
|
||||
SelectionMode="None"
|
||||
IsPullToRefreshEnabled="True"
|
||||
RowHeight="{OnPlatform Android=85}"
|
||||
SeparatorVisibility="None"
|
||||
IsPullToRefreshEnabled="True"
|
||||
Refreshing="ListView_Refreshing"
|
||||
ItemTapped="ListView_ItemTapped">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
@@ -48,5 +48,14 @@ namespace PlantBox.Client.Forms
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private async void ListView_Refreshing(object sender, EventArgs e)
|
||||
{
|
||||
var homeViewModel = (HomeViewModel)BindingContext;
|
||||
|
||||
await Task.Run(() => homeViewModel.Plants = homeViewModel.LoadPlants(App.Settings.IDs));
|
||||
|
||||
List.EndRefresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user