示例#1
0
        private void SaveTemplate(object sender, TappedRoutedEventArgs e)
        {
            errorBox.Visibility = Visibility.Collapsed;

            FieldName.ForceSetValue();
            if (FieldName.HasError)
            {
                return;
            }

            if (inspectionFormViewModel.FormQuestions.Count == 0)
            {
                errorBox.ShowError("Template moet minimaal 1 vraag bevatten.");
                return;
            }

            try
            {
                this.inspectionFormViewModel.Insert();
                Router.GoToPage <TemplatesIndex>();
            }
            catch (Exception databaseError)
            {
                errorBox.ShowError(databaseError.InnerException.Message);
            }
        }