Is it enough to specify in the listview - IsPullToRefreshEnabled = "True"
that the page can reload when you hold your finger up the screen? Do I need to write some other C # code for implementation?
|
1 answer
IsPullToRefreshEnabled="True"
not enough
It is necessary to specify in the settings of the template, an example in C #: IsPullToRefreshEnabled="True"
so understood stays swipe down
listView.Refreshing += Refresh;
indicates what method to perform when swiping down the screen with your finger. Now create a method.
public async void Refresh(object sender, EventArgs e) { listView.IsRefreshing = true;//отображает иконку загрузки listView.ItemsSource = await App.Database.GetItemsAsyncB();// здесь загружаете ваш контент снова у вас здесь может быть другой код. listView.IsRefreshing = false; // выкл. иконку загрузки }
:)
|