-
Notifications
You must be signed in to change notification settings - Fork 521
/
CreateAndEditGeometries.xaml
135 lines (134 loc) · 7.23 KB
/
CreateAndEditGeometries.xaml
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
123
124
125
126
127
128
129
130
131
132
133
134
135
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGIS.Samples.CreateAndEditGeometries.CreateAndEditGeometries"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:converters="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
<ContentPage.Resources>
<Style x:Key="IconStyle" TargetType="Button">
<Style.Setters>
<Setter Property="FontFamily" Value="calcite-ui-icons-24" />
<Setter Property="FontSize" Value="25" />
</Style.Setters>
</Style>
<converters:InvertedBoolConverter x:Key="InvertedBoolConverter" />
</ContentPage.Resources>
<Grid>
<esriUI:MapView x:Name="MyMapView" GeoViewTapped="MyMapView_GeoViewTapped" />
<Grid Margin="5,5,5,5"
ColumnSpacing="5"
HorizontalOptions="End"
RowDefinitions="auto,*"
RowSpacing="5"
VerticalOptions="Start"
WidthRequest="150">
<Button x:Name="ToggleGeometryEditorPanelButton"
Grid.Row="0"
HorizontalOptions="Fill"
Pressed="ToggleGeometryEditorPanelButton_Pressed"
Text="Show UI" />
<ScrollView x:Name="GeometryEditorPanel"
Grid.Row="1"
IsVisible="False"
MaximumHeightRequest="400">
<Grid ColumnDefinitions="auto, auto"
ColumnSpacing="5"
RowDefinitions="auto, auto, auto, auto, auto, auto, auto"
RowSpacing="5">
<Button x:Name="PointButton"
Grid.Row="0"
Clicked="PointButton_Click"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Point" />
<Button x:Name="MultipointButton"
Grid.Row="0"
Grid.Column="1"
Clicked="MultipointButton_Click"
FontSize="15"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Multipoint" />
<Button x:Name="PolylineButton"
Grid.Row="1"
Clicked="PolylineButton_Click"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Polyline / no shape fill" />
<Button x:Name="PolygonButton"
Grid.Row="1"
Grid.Column="1"
Clicked="PolygonButton_Click"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Polygon / shape fill" />
<Border Grid.Row="2"
Grid.ColumnSpan="2"
BackgroundColor="{AppThemeBinding Light={StaticResource White},
Dark={StaticResource Dark}}">
<Picker x:Name="ToolPicker"
SelectedIndexChanged="ToolPicker_SelectedIndexChanged"
ToolTipProperties.Text="Tools"
WidthRequest="150" />
</Border>
<Border Grid.Row="3"
Grid.ColumnSpan="2"
Padding="5"
Background="{AppThemeBinding Light={StaticResource White},
Dark={StaticResource Dark}}">
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<HorizontalStackLayout>
<CheckBox x:Name="UniformScaleCheckBox"
Margin="3,0,5,0"
CheckedChanged="CheckBox_CheckedChanged" />
<Label Text="Uniform Scale" VerticalOptions="Center" />
</HorizontalStackLayout>
</Border>
<Button Grid.Row="4"
Clicked="UndoButton_Click"
IsEnabled="{Binding GeometryEditor.CanUndo, Source={x:Reference MyMapView}}"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Undo" />
<Button Grid.Row="4"
Grid.Column="1"
Clicked="RedoButton_Click"
IsEnabled="{Binding GeometryEditor.CanRedo, Source={x:Reference MyMapView}}"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Redo" />
<Button Grid.Row="5"
Clicked="DeleteSelectedButton_Click"
IsEnabled="{Binding GeometryEditor.SelectedElement.CanDelete, Source={x:Reference MyMapView}, FallbackValue=False}"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Delete selected" />
<Button x:Name="SaveButton"
Grid.Row="5"
Grid.Column="1"
Clicked="SaveButton_Click"
IsEnabled="{Binding GeometryEditor.CanUndo, Source={x:Reference MyMapView}}"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Save edits" />
<Button Grid.Row="6"
Clicked="DiscardButton_Click"
IsEnabled="{Binding GeometryEditor.IsStarted, Source={x:Reference MyMapView}}"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Discard edits" />
<Button x:Name="DeleteAllButton"
Grid.Row="6"
Grid.Column="1"
Clicked="DeleteAllButton_Click"
IsEnabled="{Binding GeometryEditor.IsStarted, Source={x:Reference MyMapView}, Converter={StaticResource InvertedBoolConverter}}"
Style="{StaticResource IconStyle}"
Text=""
ToolTipProperties.Text="Delete all geometries" />
</Grid>
</ScrollView>
</Grid>
</Grid>
</ContentPage>