Add app refresh
This commit is contained in:
@@ -11,13 +11,15 @@
|
|||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<AbsoluteLayout>
|
<AbsoluteLayout>
|
||||||
<!--List-->
|
<!--List-->
|
||||||
<ListView AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
|
<ListView x:Name="List"
|
||||||
|
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
|
||||||
AbsoluteLayout.LayoutFlags="All"
|
AbsoluteLayout.LayoutFlags="All"
|
||||||
ItemsSource="{Binding Plants}"
|
ItemsSource="{Binding Plants}"
|
||||||
SelectionMode="None"
|
SelectionMode="None"
|
||||||
IsPullToRefreshEnabled="True"
|
|
||||||
RowHeight="{OnPlatform Android=85}"
|
RowHeight="{OnPlatform Android=85}"
|
||||||
SeparatorVisibility="None"
|
SeparatorVisibility="None"
|
||||||
|
IsPullToRefreshEnabled="True"
|
||||||
|
Refreshing="ListView_Refreshing"
|
||||||
ItemTapped="ListView_ItemTapped">
|
ItemTapped="ListView_ItemTapped">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<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