Search a portal for maps

Search portal maps sample
Loading

Code

<UserControl
    x:Class="ArcGISRuntime.WPF.Samples.SearchPortalMaps.SearchPortalMaps"
    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="600" d:DesignWidth="800">
    <Grid>
        <esri:MapView x:Name="MyMapView" />
        <Border
            Background="White" BorderBrush="Black" BorderThickness="1"
            HorizontalAlignment="Right" VerticalAlignment="Top"
            Margin="30" Padding="20" Width="375">
            <Grid>
                <Grid x:Name="OAuthSettingsGrid"
                      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.ColumnSpan="2"
                               FontSize="18"
                               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="Cancel"
                            Grid.Row="3" Grid.Column="0"
                            Width="70" Height="25" Margin="10,0"
                            VerticalAlignment="Center" HorizontalAlignment="Center"
                            Click="CancelOAuthSettingsClicked" />
                    <Button Content="Save OAuth Settings"
                            Grid.Row="3" Grid.Column="1"
                            Width="150" Height="25" Margin="10,0"
                            VerticalAlignment="Center" HorizontalAlignment="Left"
                            Click="SaveOAuthSettingsClicked" />
                </Grid>
                <Grid x:Name="SearchUI" Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition Height="100" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <RadioButton x:Name="SearchPublicMaps"
                                 Grid.Column="0" Grid.Row="0"
                                 HorizontalAlignment="Left"
                                 IsChecked="True"
                                 Content="Search public maps:"
                                 Unchecked="RadioButtonUnchecked" />
                    <TextBox x:Name="SearchText"
                             Grid.Column="1" Grid.Row="0"
                             IsEnabled="{Binding ElementName=SearchPublicMaps, Path=IsChecked}" />
                    <RadioButton x:Name="BrowseMyMaps"
                                 Grid.Column="0" Grid.Row="1"
                                 Unchecked="RadioButtonUnchecked"
                                 HorizontalAlignment="Left"
                                 Content="Browse my maps" />
                    <Button x:Name="SearchButton"
                            Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2"
                            Content="Get maps"
                            Margin="0,5,0,0"
                            Click="SearchButton_Click" />
                    <ListBox x:Name="MapListBox"
                             Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2"
                             SelectionMode="Single"
                             Margin="0,5,0,0"
                             DisplayMemberPath="Title"
                             ScrollViewer.HorizontalScrollBarVisibility="Disabled"/>
                    <Button x:Name="LoadMapButton"
                            Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2"
                            Content="Load selected map"
                            Margin="0,5,0,0"
                            Click="LoadMapButtonClick" />
                </Grid>
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code