Example #1
0
        public MyReservationsViewModel(UserReservationsModel reservationsModel, INavigationService navigationService) : base(navigationService)
        {
            this.reservationRepository    = new FakeReservationRepository(new HttpService(new CustomDependencyService(), new HttpClientHandler()));
            this.reservationService       = new ReservationService(this.reservationRepository);
            this.RemoveReservationCommand = new Command <ReservationViewModel>(this.RemoveReservation);

            this.LoadReservations(reservationsModel);
        }
        public MyReservationsPage(UserReservationsModel reservationsModel)
        {
            this.InitializeComponent();
            var viewModel = new MyReservationsViewModel(reservationsModel, new NavigationService(this.Navigation));

            viewModel.ShowInfoMessage += this.ShowInfoMessage;
            viewModel.ShowRemoveConfirmationDialog += this.ShowRemoveConfirmationDialog;
            this.BindingContext = viewModel;
        }
Example #3
0
        private async void LoadReservations(UserReservationsModel reservationsResult)
        {
            var todayReservations    = reservationsResult.TodayReservations;
            var recursiveReservation = reservationsResult.AllReservations.Where(x => x.IsRecursive);
            var allReservations      = reservationsResult.AllReservations;

            this.TodayReservationsViewModel     = new ReservationsListViewModel(this.NavigationService, this, todayReservations, true);
            this.RecursiveReservationsViewModel = new ReservationsListViewModel(this.NavigationService, this, recursiveReservation);
            this.AllReservationsViewModel       = new ReservationsListViewModel(this.NavigationService, this, allReservations);
        }