Ejemplo n.º 1
0
        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");
            //}
        }
Ejemplo n.º 2
0
        public async Task InitializeDataAsync()
        {
            IsBusy = true;
            var reservationsservices = new ReservationsServices();

            ReservationsList = await reservationsservices.GetReservationsAsync();

            IsBusy = false;
        }
Ejemplo n.º 3
0
        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;
        }