示例#1
0
        private async void AddSectionButton_Click(object sender, RoutedEventArgs e)
        {
            if (await AddSectionDialog.ShowAsync() != ContentDialogResult.Primary)
            {
                return;
            }

            try
            {
                var model = new SectionDTO()
                {
                    Name        = CreateSectionName.Text,
                    SectionType = CreateSectionType.SelectedItem.ToString()
                };

                await _service.AddTripSection(_trip.Id, model);

                _sections.Add(model.MapToSection());

                Frame.Navigate(GetType(), _navigationParams, new SuppressNavigationTransitionInfo()); //on add, frame just does not want to load...
            }
            catch
            {
                //TODO: Exception handling
            }
        }