-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathMainWindow.xaml
74 lines (68 loc) · 4.18 KB
/
MainWindow.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
<Window x:Class="EditorDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:EditorDemo"
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
xmlns:Behaviors="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
Title="Geometry Editor Sample" Height="450" Width="800">
<Window.Resources>
<local:MapViewModel x:Key="VM" />
<local:BoolToVisibilityConverter x:Key="converter" />
</Window.Resources>
<Grid DataContext="{StaticResource VM}">
<esri:MapView Map="{Binding Map, Mode=OneWay}" x:Name="mapView"
esri:GeoViewController.GeoViewController="{Binding Controller, Source={StaticResource VM}}"
GraphicsOverlays="{Binding GraphicsOverlays, Mode=OneWay}"
GeometryEditor="{Binding GeometryEditor, ElementName=editor, Mode=OneWay}" >
<Behaviors:Interaction.Triggers>
<Behaviors:EventTrigger EventName="GeoViewTapped" >
<Behaviors:InvokeCommandAction Command="{Binding GeoViewTappedCommand}" PassEventArgsToCommand="True" />
</Behaviors:EventTrigger>
</Behaviors:Interaction.Triggers>
</esri:MapView>
<Border Background="White" BorderThickness="1" BorderBrush="Black" Margin="20" HorizontalAlignment="Right" VerticalAlignment="Top" CornerRadius="2">
<Behaviors:Interaction.Behaviors>
<Behaviors:MouseDragElementBehavior ConstrainToParentBounds="True" />
</Behaviors:Interaction.Behaviors>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border Background="CornflowerBlue" Padding="5,1,0,2">
<TextBlock Text="Geometry Editor" Foreground="White" FontWeight="SemiBold" />
</Border>
<local:EditorToolbar x:Name="editor" GeoElement="{Binding EditFeatureSelection, Source={StaticResource VM}}"
GraphicsOverlays="{Binding GraphicsOverlays, ElementName=mapView, Mode=OneWay}"
Grid.Row="1" Margin="2">
<Behaviors:Interaction.Triggers>
<Behaviors:EventTrigger EventName="EditingCompleted" >
<Behaviors:InvokeCommandAction Command="{Binding EditingCompletedCommand, Source={StaticResource VM}}" PassEventArgsToCommand="True" />
</Behaviors:EventTrigger>
<Behaviors:EventTrigger EventName="EditingCancelled" >
<Behaviors:InvokeCommandAction Command="{Binding EditingCancelledCommand, Source={StaticResource VM}}" />
</Behaviors:EventTrigger>
</Behaviors:Interaction.Triggers>
</local:EditorToolbar>
</Grid>
</Border>
<Border Background="White" BorderThickness="1" BorderBrush="Black" Margin="20" HorizontalAlignment="Left" VerticalAlignment="Top" CornerRadius="2" DataContext="{Binding Path=DataContext, ElementName=editor}" Visibility="{Binding IsSettingsPanelVisible, Converter={StaticResource converter}}">
<Behaviors:Interaction.Behaviors>
<Behaviors:MouseDragElementBehavior ConstrainToParentBounds="True" />
</Behaviors:Interaction.Behaviors>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border Background="CornflowerBlue" Padding="5,1,0,2">
<TextBlock Text="Settings" Foreground="White" FontWeight="SemiBold" />
</Border>
<local:SettingsMenu Grid.Row="1" Margin="2" />
</Grid>
</Border>
</Grid>
</Window>