ArcGIS Runtime SDK for .NET Samples

Search a portal for maps

Search portal maps sample
Loading

Code

<UserControl 
    x:Class="ArcGISRuntime.UWP.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="using:Esri.ArcGISRuntime"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls" 
    mc:Ignorable="d" 
    d:DesignHeight="500" d:DesignWidth="600">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <CommandBar>
            <AppBarButton Width="100" AllowFocusOnInteraction="True"
                Content="Search Maps">
                <AppBarButton.Flyout>
                    <Flyout x:Name="SearchMapsFlyout">
                        <Grid Width="300">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="2*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Row="0" Grid.Column="0"
                                       VerticalAlignment="Center" HorizontalAlignment="Right"
                                       Text="Keyword:"/>
                            <TextBox x:Name="SearchText"
                                     Grid.Row="0" Grid.Column="1"
                                     Margin="5"
                                     HorizontalAlignment="Stretch"/>
                            <Button x:Name="SearchMapsButton"
                                    Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
                                    HorizontalAlignment="Stretch"
                                    Margin="10"
                                    Content="Search"
                                    Click="SearchMapsClicked"/>
                            <ListView x:Name="SearchMapsList"
                                     Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
                                     DisplayMemberPath="Title"
                                     HorizontalAlignment="Stretch"
                                     Height="100"
                                     SelectionChanged="OnMapSelectionChanged"/>
                        </Grid>
                    </Flyout>
                </AppBarButton.Flyout>
            </AppBarButton>
            <AppBarButton Width="80"
                Content="My Maps" 
                Click="MyMapsClicked">
                <AppBarButton.Flyout>
                    <Flyout x:Name="MyMapsFlyout">
                        <ListView x:Name="MyMapsList" 
                                  DisplayMemberPath="Title" 
                                  SelectionChanged="OnMapSelectionChanged"/>
                    </Flyout>
                </AppBarButton.Flyout>
            </AppBarButton>
        </CommandBar>
        <esriUI:MapView x:Name="MyMapView" 
                        Grid.Row="1"/>
        <ContentDialog x:Name="OAuthSettingsDialog" 
                       Grid.Row="1"
                       PrimaryButtonText="Save" SecondaryButtonText="Cancel"
                       Title="OAuth Configuration Settings">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <TextBlock Text="Client ID:"
                           Grid.Row="0"
                           HorizontalAlignment="Right" VerticalAlignment="Center"
                           Margin="5,0"/>
                <TextBox x:Name="ClientIdTextBox"
                         Grid.Row="0" Grid.Column="1"
                         HorizontalAlignment="Left" VerticalAlignment="Center"
                         Width="220"
                         IsReadOnly="True"
                         Margin="0,3"/>
                <TextBlock Text="Redirect URL:"
                           Grid.Row="1"
                           HorizontalAlignment="Right" VerticalAlignment="Center"
                           Margin="5,0"/>
                <TextBox x:Name="RedirectUrlTextBox" 
                         Grid.Row="1" Grid.Column="1"
                         HorizontalAlignment="Left" VerticalAlignment="Center"
                         Width="220"
                         IsReadOnly="True"
                         Margin="0,3"/>
            </Grid>
        </ContentDialog>
    </Grid>
</UserControl>


In this topic
  1. Code