Sketch graphics on the map

Sketch on map sample
Loading

Code

<UserControl
    x:Class="ArcGISRuntime.UWP.Samples.SketchOnMap.SketchOnMap"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid>
        <esriUI:MapView x:Name="MyMapView"/>
        <CommandBar>
            <AppBarButton AllowFocusOnInteraction="True">
                <AppBarButton.Content>
                    <TextBlock Text="Draw/Edit" HorizontalAlignment="Center"/>
                </AppBarButton.Content>
                <AppBarButton.Flyout>
                    <Flyout x:Name="DrawToolsFlyout">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="5"/>
                                <RowDefinition Height="35"/>
                                <RowDefinition Height="35"/>
                                <RowDefinition Height="35"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Row="1" Grid.Column="0" 
                                       HorizontalAlignment="Right" VerticalAlignment="Center"
                                       FontSize="12"
                                       Text="Sketch shape:"/>
                            <ComboBox x:Name="SketchModeComboBox"
                                      Grid.Row="1" Grid.Column="1"
                                      HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                      Margin="2"
                                      FontSize="12"/>
                            <Button Grid.Row="2" Grid.Column="1" 
                                    FontSize="12"
                                    Content="Draw"
                                    Margin="2"
                                    Width="100" Height="30"
                                    HorizontalAlignment="Center" VerticalAlignment="Top"
                                    Click="DrawButtonClick"/>
                            <Button x:Name="EditButton" 
                                    Grid.Row="3" Grid.Column="1"
                                    Content="Edit"
                                    Margin="2"
                                    FontSize="12"
                                    Width="100" Height="30"
                                    HorizontalAlignment="Center" VerticalAlignment="Top"
                                    IsEnabled="False"
                                    Click="EditButtonClick"/>
                        </Grid>
                    </Flyout>
                </AppBarButton.Flyout>
            </AppBarButton>
            <AppBarButton Command="{Binding UndoCommand}">
                <AppBarButton.Content>
                    <TextBlock Text="Undo" HorizontalAlignment="Center"/>
                </AppBarButton.Content>
            </AppBarButton>
            <AppBarButton Command="{Binding RedoCommand}">
                <AppBarButton.Content>
                    <TextBlock Text="Redo" HorizontalAlignment="Center"/>
                </AppBarButton.Content>
            </AppBarButton>
            <AppBarButton Command="{Binding CompleteCommand}">
                <AppBarButton.Content>
                    <TextBlock Text="Complete" HorizontalAlignment="Center"/>
                </AppBarButton.Content>
            </AppBarButton>
            <AppBarButton x:Name="ClearButton"
                          Click="ClearButtonClick">
                <AppBarButton.Content>
                    <TextBlock Text="Clear" HorizontalAlignment="Center"/>
                </AppBarButton.Content>
            </AppBarButton>
        </CommandBar>
    </Grid>
</UserControl>


In this topic
  1. Code