示例#1
0
        private async void AddTodo_Button_OnClick(object sender, RoutedEventArgs e)
        {
            AddTodoName.Text = "";
            AddTodoDesc.Text = "";

            if (await AddTodoDialog.ShowAsync() != ContentDialogResult.Primary)
            {
                return;
            }

            try
            {
                var todo = new ItemDTO()
                {
                    Title       = AddTodoName.Text,
                    Description = AddTodoDesc.Text
                };

                var newItem = await _service.AddTodoItem(_tripId, _sectionId, todo);

                _todoItems.Add(newItem);
                _tripDetailsPage.UpdateProgressBar();
                Bindings.Update();
            }
            catch
            {
                //TODO exception handling
            }
        }