ArcGIS Runtime SDK for .NET Samples

Author a map

Author map (iOS)

Loading

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.AuthorMap.AuthorMap"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="120" />
                <RowDefinition Height="90" />
                <RowDefinition Height="110" />
                <RowDefinition Height="40" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="115" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <TextBlock Text="Select a Basemap:"
                       Grid.Row="0"
                       VerticalAlignment="Top" HorizontalAlignment="Right"
                       Margin="10" />
            <ListBox x:Name="BasemapListBox"
                     Grid.Row="0" Grid.Column="1"
                     VerticalAlignment="Top" HorizontalAlignment="Left"
                     Height="100" Width="150" Margin="10"
                     SelectionChanged="BasemapSelectionChanged" />
            <TextBlock Text="Choose Layers:"
                       Grid.Row="1" Grid.Column="0"
                       VerticalAlignment="Top" HorizontalAlignment="Right"
                       Margin="10,0" />
            <ListBox x:Name="OperationalLayerListBox"
                     SelectionMode="Multiple"
                     Grid.Row="1" Grid.Column="1"
                     VerticalAlignment="Top" HorizontalAlignment="Left"
                     Height="75" Width="150"
                     Margin="10,0"
                     SelectionChanged="OperationalLayerSelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Key}" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <TextBlock Text="Initial Extent:"
                       Grid.Row="2" Grid.Column="0"
                       VerticalAlignment="Top" HorizontalAlignment="Right"
                       Margin="10,0" />
            <StackPanel Orientation="Vertical"
                        Grid.Row="2" Grid.Column="1"
                        Margin="10,0,0,0" Width="150">
                <StackPanel Orientation="Horizontal"
                            Margin="0,3">
                    <TextBlock Text="X Min:" />
                    <TextBox x:Name="XMinTextBox"
                             Margin="6,0" Width="80"
                             IsReadOnly="True"
                             Text="" />
                </StackPanel>
                <StackPanel Orientation="Horizontal"
                            Margin="0,3">
                    <TextBlock Text="Y Min:" />
                    <TextBox x:Name="YMinTextBox"
                             Margin="6,0" Width="80"
                             IsReadOnly="True"
                             Text="" />
                </StackPanel>
                <StackPanel Orientation="Horizontal"
                            Margin="0,3">
                    <TextBlock Text="X Max:" />
                    <TextBox x:Name="XMaxTextBox"
                             Margin="5,0" Width="80"
                             IsReadOnly="True"
                             Text="" />
                </StackPanel>
                <StackPanel Orientation="Horizontal"
                            Margin="0,3">
                    <TextBlock Text="Y Max:" />
                    <TextBox x:Name="YMaxTextBox"
                             Margin="5,0" Width="80"
                             IsReadOnly="True"
                             Text="" />
                </StackPanel>
            </StackPanel>
            <Button Content="New Map"
                    Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
                    VerticalAlignment="Top" HorizontalAlignment="Center"
                    Width="120" Height="25" Margin="10,0"
                    Click="ClearMapClicked" />
            <Grid x:Name="SaveMapGrid"
                  Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2"
                  Visibility="Collapsed">
                <Grid.RowDefinitions>
                    <RowDefinition Height="40" />
                    <RowDefinition Height="40" />
                    <RowDefinition Height="40" />
                    <RowDefinition Height="40" />
                    <RowDefinition Height="60" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="115" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right"
                           Text="Title:" />
                <TextBox x:Name="TitleTextBox"
                         Grid.Row="0" Grid.Column="1"
                         VerticalAlignment="Bottom" HorizontalAlignment="Left"
                         Width="150" Margin="10,0"
                         Text="My Map" />
                <TextBlock Text="Description:"
                           Grid.Row="1" Grid.Column="0"
                           VerticalAlignment="Top" HorizontalAlignment="Right"
                           Margin="0,10" />
                <TextBox x:Name="DescriptionTextBox"
                         Grid.Row="1" Grid.Column="1"
                         VerticalAlignment="Top" HorizontalAlignment="Left"
                         Width="150" Height="50" Margin="10"
                         TextWrapping="Wrap"
                         Text="Authored and saved using ArcGIS Runtime SDK." />
                <TextBlock Text="Tags:"
                           Grid.Row="2" Grid.Column="0"
                           VerticalAlignment="Top" HorizontalAlignment="Right" />
                <TextBox x:Name="TagsTextBox"
                         Grid.Row="2" Grid.Column="1"
                         VerticalAlignment="Top" HorizontalAlignment="Left"
                         Width="150" Margin="10,0"
                         Text="ArcGIS Runtime, Sample" />
                <Button Content="Save Map to Portal"
                        Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
                        IsEnabled="{Binding ElementName=MyMapView }"
                        Width="170" Height="25" Margin="10,0"
                        VerticalAlignment="Center" HorizontalAlignment="Center"
                        Click="SaveMapClicked" />
                <ProgressBar x:Name="SaveProgressBar"
                             Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2"
                             Height="15"
                             IsIndeterminate="True" Visibility="Hidden" />
            </Grid>
            <Grid x:Name="OAuthSettingsGrid"
                  Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2"
                  Visibility="Visible">
                <Grid.RowDefinitions>
                    <RowDefinition Height="60" />
                    <RowDefinition Height="40" />
                    <RowDefinition Height="40" />
                    <RowDefinition Height="40" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="115" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock Text="OAuth Settings"
                           Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                           VerticalAlignment="Bottom" HorizontalAlignment="Center" />
                <TextBlock Text="Client ID:"
                           Grid.Row="1" Grid.Column="0"
                           VerticalAlignment="Bottom" HorizontalAlignment="Right" />
                <TextBox x:Name="ClientIdTextBox"
                         Grid.Row="1" Grid.Column="1"
                         VerticalAlignment="Bottom" HorizontalAlignment="Left"
                         Width="150" Margin="10,0" />
                <TextBlock Text="Redirect URL:"
                           Grid.Row="2" Grid.Column="0"
                           VerticalAlignment="Top" HorizontalAlignment="Right"
                           Margin="0,10" />
                <TextBox x:Name="RedirectUrlTextBox"
                         Grid.Row="2" Grid.Column="1"
                         VerticalAlignment="Top" HorizontalAlignment="Left"
                         Width="150" Margin="10" />
                <Button Content="Save OAuth Settings"
                        Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
                        Width="170" Height="25" Margin="10,0"
                        VerticalAlignment="Center" HorizontalAlignment="Center"
                        Click="SaveOAuthSettingsClicked" />
            </Grid>
        </Grid>
        <esri:MapView x:Name="MyMapView"
                      Grid.Column="1" />
    </Grid>
</UserControl>


In this topic
  1. Code