Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,16 @@ private async void SaveButton_Click(object sender, EventArgs e)
// Stop the geometry editor and get the updated geometry.
Geometry geometry = MyMapView.GeometryEditor.Stop();

// Update the feature with the new geometry.
_selectedFeature.Geometry = geometry;
await ((GeodatabaseFeatureTable)_selectedFeature.FeatureTable).UpdateFeatureAsync(_selectedFeature);
try
{
// Update the feature with the new geometry.
_selectedFeature.Geometry = geometry;
await ((GeodatabaseFeatureTable)_selectedFeature.FeatureTable).UpdateFeatureAsync(_selectedFeature);
}
catch (Exception ex)
{
await Application.Current.Windows[0].Page.DisplayAlert("Error", ex.ToString(), "OK");
}

// Reset the selection.
ResetSelections();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
using System.Windows;
using System.Windows.Media;
using Esri.ArcGISRuntime.UI.Editing;
using Geometry = Esri.ArcGISRuntime.Geometry.Geometry;
using ArcGIS.Samples.Managers;
using Esri.ArcGISRuntime.UtilityNetworks;
using System.Collections.Generic;
using Geometry = Esri.ArcGISRuntime.Geometry.Geometry;

namespace ArcGIS.WPF.Samples.SnapGeometryEditsWithUtilityNetworkRules
{
Expand Down Expand Up @@ -269,9 +269,16 @@ private async void SaveButton_Click(object sender, RoutedEventArgs e)
// Stop the geometry editor and get the updated geometry.
Geometry geometry = MyMapView.GeometryEditor.Stop();

// Update the feature with the new geometry.
_selectedFeature.Geometry = geometry;
await ((GeodatabaseFeatureTable)_selectedFeature.FeatureTable).UpdateFeatureAsync(_selectedFeature);
try
{
// Update the feature with the new geometry.
_selectedFeature.Geometry = geometry;
await ((GeodatabaseFeatureTable)_selectedFeature.FeatureTable).UpdateFeatureAsync(_selectedFeature);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error");
}

// Reset the selection.
ResetSelections();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,16 @@ private async void SaveButton_Click(object sender, RoutedEventArgs e)
// Stop the geometry editor and get the updated geometry.
Geometry geometry = MyMapView.GeometryEditor.Stop();

// Update the feature with the new geometry.
_selectedFeature.Geometry = geometry;
await ((GeodatabaseFeatureTable)_selectedFeature.FeatureTable).UpdateFeatureAsync(_selectedFeature);
try
{
// Update the feature with the new geometry.
_selectedFeature.Geometry = geometry;
await ((GeodatabaseFeatureTable)_selectedFeature.FeatureTable).UpdateFeatureAsync(_selectedFeature);
}
catch (Exception ex)
{
await new MessageDialog2(ex.ToString(), "Error").ShowAsync();
}

// Reset the selection.
ResetSelections();
Expand Down
Loading