protected async override void OnAppearing() { base.OnAppearing(); // OnPropertyChanged(); viewModel.IsBusy = true; var reservationsservices = new ReservationsServices(); viewModel.ReservationsList = await reservationsservices.GetReservationsAsync(); viewModel.IsBusy = false; // await DisplayAlert("Erorr!", "Check Your Connection !", "Ok"); //if (CrossConnectivity.Current.IsConnected) //{ // // viewModel.IsBusy = true; // var reservationsservices = new ReservationsServices(); // viewModel.ReservationsList = await reservationsservices.GetReservationsAsync(); // // viewModel.IsBusy = false; //} //else //{ // await DisplayAlert("Erorr!", "Check Your Connection !", "Ok"); //} }
public async Task InitializeDataAsync() { IsBusy = true; var reservationsservices = new ReservationsServices(); ReservationsList = await reservationsservices.GetReservationsAsync(); IsBusy = false; }
private async void SearchBar_TextChanged(object sender, TextChangedEventArgs e) { var reservationsViewModels = BindingContext as ReservationsViewModels; var reservationsservices = new ReservationsServices(); viewModel.IsBusy = true; viewModel.Keyword = SearchBar.Text; if (viewModel.Keyword != "") { viewModel.ReservationsList = await reservationsservices.GetReservationsByKeywordAsync(viewModel.Keyword); } else { // ReservaitionsList.ItemsSource = viewModel.ReservationsList; viewModel.ReservationsList = await reservationsservices.GetReservationsAsync(); } viewModel.IsBusy = false; }