/// <summary> /// Adds a new related record to highlighted feature. /// </summary> private async void AddButton_Click(object sender, RoutedEventArgs e) { SetAttributeEditor(); var featureID = (Int64)AddButton.Tag; var requestID = (string)RelatedRecords.Tag; string message = null; try { if (table == null) { table = await GetRelatedTableAsync(); } var feature = new GeodatabaseFeature(table.Schema); feature.Attributes[relationship.KeyField] = requestID; feature.Attributes["rank"] = 5; feature.Attributes["comments"] = "Describe service requirement here."; feature.Attributes["submitdt"] = DateTime.UtcNow; var relatedFeatureID = await table.AddAsync(feature); await SaveEditsAsync(); await QueryRelatedRecordsAsync(); } catch (Exception ex) { message = ex.Message; } if (!string.IsNullOrWhiteSpace(message)) { await new MessageDialog(message).ShowAsync(); } }