-
Notifications
You must be signed in to change notification settings - Fork 531
Expand file tree
/
Copy pathCreateAndEditGeometries.xaml
More file actions
122 lines (122 loc) · 5.86 KB
/
CreateAndEditGeometries.xaml
File metadata and controls
122 lines (122 loc) · 5.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<UserControl x:Class="ArcGIS.WinUI.Samples.CreateAndEditGeometries.CreateAndEditGeometries"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
<UserControl.Resources>
<Style x:Key="IconStyle" TargetType="Button">
<Style.Setters>
<Setter Property="FontFamily" Value="/Resources/Fonts/calcite-ui-icons-24.ttf#calcite-ui-icons-24" />
<Setter Property="FontSize" Value="25" />
<Setter Property="Background" Value="White" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style.Setters>
</Style>
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
</UserControl.Resources>
<Grid>
<esriUI:MapView x:Name="MyMapView" GeoViewTapped="MyMapView_GeoViewTapped" />
<Grid Margin="10"
Padding="10"
HorizontalAlignment="Right"
VerticalAlignment="Top"
ColumnSpacing="5"
RowSpacing="5">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70" />
<ColumnDefinition Width="75" />
</Grid.ColumnDefinitions>
<Button x:Name="PointButton"
Click="PointButton_Click"
Content=""
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Point" />
<Button x:Name="MultipointButton"
Grid.Row="0"
Grid.Column="1"
Click="MultipointButton_Click"
Content=""
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Multipoint" />
<Button x:Name="PolylineButton"
Grid.Row="1"
Click="PolylineButton_Click"
Content=""
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Polyline / no shape fill" />
<Button x:Name="PolygonButton"
Grid.Row="1"
Grid.Column="2"
Click="PolygonButton_Click"
Content=""
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Polygon / shape fill" />
<ComboBox x:Name="ToolComboBox"
Grid.Row="2"
Grid.ColumnSpan="2"
HorizontalAlignment="Stretch"
Background="White"
SelectionChanged="ToolComboBox_SelectionChanged"
ToolTipService.ToolTip="Tools" />
<Border Grid.Row="3"
Grid.ColumnSpan="2"
Padding="3"
Background="White">
<CheckBox x:Name="UniformScaleCheckBox"
Checked="CheckBox_CheckedChanged"
Content="Uniform Scale"
Unchecked="CheckBox_CheckedChanged" />
</Border>
<Button Grid.Row="4"
Click="UndoButton_Click"
Content=""
IsEnabled="{Binding GeometryEditor.CanUndo, ElementName=MyMapView}"
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Undo" />
<Button Grid.Row="4"
Grid.Column="2"
Click="RedoButton_Click"
Content=""
IsEnabled="{Binding GeometryEditor.CanRedo, ElementName=MyMapView}"
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Redo" />
<Button Grid.Row="5"
Click="DeleteSelectedButton_Click"
Content=""
IsEnabled="{Binding GeometryEditor.SelectedElement.CanDelete, ElementName=MyMapView, FallbackValue=False}"
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Delete selected" />
<Button x:Name="SaveButton"
Grid.Row="5"
Grid.Column="1"
Click="SaveButton_Click"
Content=""
IsEnabled="{Binding GeometryEditor.CanUndo, ElementName=MyMapView}"
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Save edits" />
<Button Grid.Row="6"
Click="DiscardButton_Click"
Content=""
IsEnabled="{Binding GeometryEditor.IsStarted, ElementName=MyMapView}"
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Discard edits" />
<Button x:Name="DeleteAllButton"
Grid.Row="6"
Grid.Column="1"
Click="DeleteAllButton_Click"
Content=""
IsEnabled="{Binding GeometryEditor.IsStarted, ElementName=MyMapView, Converter={StaticResource BoolNegationConverter}}"
Style="{StaticResource IconStyle}"
ToolTipService.ToolTip="Delete all geometries" />
</Grid>
</Grid>
</UserControl>