Skip to content

Commit

Permalink
Fix issue with Geodatabase transactions sample when navigating away (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
duffh authored Aug 14, 2023
1 parent f1bb440 commit d56c402
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private async Task LoadLocalGeodatabaseTables()

// Create a new feature layer to show the table in the map.
FeatureLayer layer = new FeatureLayer(table);
Dispatcher.Invoke(() => MyMapView.Map.OperationalLayers.Add(layer));
Dispatcher.Invoke(() => MyMapView.Map?.OperationalLayers.Add(layer));
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private async Task LoadLocalGeodatabaseTables()

// Create a new feature layer to show the table in the map.
FeatureLayer layer = new FeatureLayer(table);
DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () => MyMapView.Map.OperationalLayers.Add(layer));
DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () => MyMapView.Map?.OperationalLayers.Add(layer));
}
catch (Exception e)
{
Expand Down

0 comments on commit d56c402

Please sign in to comment.