private async void ListView_OnRefreshing(object sender, EventArgs e) { try { ChatData.Disconnect(); ChatData.Connect(); ListView.IsRefreshing = false; await ChatData.GetData(OutputMessages, ListView); } catch (SocketException ex) { await DisplayAlert("Socket exception", ex.Message, "Ok"); } catch (Exception exception) { await DisplayAlert("Error", exception.Message, "Ok"); } }