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 @@ -65,7 +65,6 @@
Grid.ColumnSpan="2"
HorizontalAlignment="Stretch"
Background="White"
DisplayMemberPath="Key"
SelectionChanged="ToolComboBox_SelectionChanged"
ToolTipService.ToolTip="Tools" />
<Border Grid.Row="3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private void Initialize()
MyMapView.GeometryEditor = _geometryEditor;

// Create vertex and freehand tools for the combo box.
ToolComboBox.ItemsSource = _toolDictionary = new Dictionary<string, object>()
_toolDictionary = new Dictionary<string, object>()
{
{ "Vertex Tool", new VertexTool() },
{ "Reticle Vertex Tool", new ReticleVertexTool() },
Expand All @@ -118,6 +118,8 @@ private void Initialize()
{ "Triangle Shape Tool", ShapeTool.Create(ShapeToolType.Triangle) }
};

ToolComboBox.ItemsSource = _toolDictionary.Keys;

// Have the vertex tool selected by default.
ToolComboBox.SelectedIndex = 0;

Expand Down Expand Up @@ -196,7 +198,8 @@ private void PolygonButton_Click(object sender, RoutedEventArgs e)
private void ToolComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// Set the geometry editor tool based on the new selection.
_geometryEditor.Tool = ((KeyValuePair<string, object>)ToolComboBox.SelectedItem).Value as GeometryEditorTool;
GeometryEditorTool tool = _toolDictionary[ToolComboBox.SelectedItem.ToString()] as GeometryEditorTool;
_geometryEditor.Tool = tool;

// Account for case when vertex tool is selected and geometry editor is started with a polyline or polygon geometry type.
// Ensure point and multipoint buttons are only enabled when the selected tool is a vertex tool.
Expand Down
Loading