Download preplanned map areas

Download preplanned map areas
Loading

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.DownloadPreplannedMapAreas.DownloadPreplannedMapAreas"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <!-- Show the map. -->
        <esri:MapView x:Name="MyMapView" Grid.Row="0" />

        <!-- Show a message when the map isn't visible. -->
        <Grid x:Name="DownloadNotificationText"
              Grid.Row="0"
              Background="White"
              Visibility="Collapsed">
            <TextBlock
                Text="Download preplanned map area"
                HorizontalAlignment="Left" VerticalAlignment="Center"
                FontSize="20" />
        </Grid>

        <!-- Show a selection list. -->
        <Border x:Name="PreplannedAreasLarge" Grid.Row="0"
                Background="White" BorderBrush="Black" BorderThickness="1"
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Margin="30" Padding="20" Width="auto"
                Visibility="Visible">
            <StackPanel>
                <TextBlock Text="Select area for download:" />
                <ListView x:Name="PreplannedAreasList"
                          SelectionChanged="OnDownloadMapAreaClicked">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <Image Grid.RowSpan="2"
                                       Source="{Binding PortalItem.ThumbnailUri}"
                                       Height="70" Margin="-10,2,2,2" Stretch="UniformToFill" />
                                <TextBlock Grid.Column="1"
                                           Text="{Binding PortalItem.Title}"
                                           Margin="10,0" VerticalAlignment="Center"
                                           Foreground="Gray" />
                            </Grid>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
                <Button x:Name="DeleteMapAreaButton"
                        Content="Delete offline areas"
                        HorizontalAlignment="Stretch"
                        Margin="5"
                        Click="OnDeleteAllMapAreasClicked" />
            </StackPanel>
        </Border>

        <!-- Busy indication -->
        <Grid x:Name="BusyIndicator"
              Grid.Row="0" Grid.RowSpan="2"
              Background="#807f7f7f">
            <Grid
                HorizontalAlignment="Center" VerticalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <TextBlock Foreground="White" Margin="10" FontSize="18">
                    <Run x:Name="BusyText" Text="Querying map areas..." />
                    <Run x:Name="BusyPercentage" Text="" />
                </TextBlock>
                <ProgressBar x:Name="ProgressBar"
                             Grid.Row="1"
                             IsEnabled="True" IsIndeterminate="True"
                             Width="100" Height="10"
                             HorizontalAlignment="Center" VerticalAlignment="Center" />
            </Grid>
        </Grid>
    </Grid>
</UserControl>


In this topic
  1. Code