Esempio n. 1
0
        private async Task CreateBookingLogic(Booking b)
        {
            try
            {
                Dispatcher.Invoke(() =>
                {
                    lblLoading.Content = "LOADING..";
                });

                await _bikeService.CreateBookingAsync(b);

                Dispatcher.Invoke(() =>
                {
                    _window.Content = new MyBookingsPage(_window);
                });
            }
            catch (EndpointNotFoundException)
            {
                MessageBox.Show("forbindelse ikke fundet");
            }

            catch (FaultException e)
            {
                MessageBox.Show(e.Message);

                this.Dispatcher.Invoke(() =>
                {
                    _window.Content = new ViewAdPage(_window, _ad.Id, false);
                });
            }
        }