ArcGIS Runtime SDK for .NET Samples

Search a portal for maps

Search portal maps sample
Loading

Code

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"             
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
             x:Class="ArcGISRuntime.Samples.SearchPortalMaps.SearchPortalMaps">
  <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
      <RowDefinition/>
      <RowDefinition Height="70"/>
    </Grid.RowDefinitions>

        <esriUI:MapView x:Name="MyMapView"
                        Grid.Row="0"/>
        <TableView x:Name="SearchMapsUI"
                   Grid.Row="0"
                   IsVisible="False"
                   Intent="Form">
            <TableRoot>
                <TableSection Title="Search Public Maps">
                    <EntryCell x:Name="SearchTextEntry"
                               Label="Search Text:"
                               Text=""/>
                    <ViewCell>
                        <StackLayout Orientation="Horizontal"
                                     HorizontalOptions="CenterAndExpand">
                            <Button Text="Cancel"
                                    Clicked="CancelSearchClicked"
                                    Margin="20,0"/>
                            <Button Text="Search"
                                    Clicked="SearchMapsClicked"/>
                        </StackLayout>
                    </ViewCell>
                </TableSection>
            </TableRoot>
        </TableView>
        <ListView x:Name="MapsListView" 
                  IsVisible="False"
                  ItemSelected="MapItemSelected">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <ViewCell.View>
                            <StackLayout>
                                <Label Text="{Binding Title}"/>
                            </StackLayout>
                        </ViewCell.View>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <Grid x:Name="OAuthSettingsGrid" 
          Grid.Row="0"
          HorizontalOptions="Center" VerticalOptions="Center"
          WidthRequest="300">
            <Grid.RowDefinitions>
                <RowDefinition Height="60"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Grid.ColumnSpan="2" 
             HorizontalOptions="Center" VerticalOptions="Start"
             Text="OAuth Settings"/>
            <Label Grid.Row="1"
             HorizontalOptions="End" VerticalOptions="Center"
             Text="Client ID:"/>
            <Entry x:Name="ClientIDEntry" 
             Grid.Row="1" Grid.Column="1" 
             Placeholder="mYCl1enTiD"
             HorizontalOptions="Start" VerticalOptions="Center"
             WidthRequest="240"/>
            <Label Grid.Row="2"
             HorizontalOptions="End" VerticalOptions="Center"
             Text="Redirect URL:"/>
            <Entry x:Name="RedirectUrlEntry" 
             Grid.Row="2" Grid.Column="1" 
             Placeholder="http://my.redirect/url"
             HorizontalOptions="Start" VerticalOptions="Center"
             WidthRequest="240"/>
            <Button Grid.Row="3" Grid.Column="0"
              HorizontalOptions="End" VerticalOptions="End"
              Text="Cancel"
              Clicked="OAuthSettingsCancel"/>
            <Button Grid.Row="3" Grid.Column="1"
              HorizontalOptions="CenterAndExpand" VerticalOptions="End"
              Text="Use Settings"
              Clicked="SaveOAuthSettings"/>
        </Grid>
        <StackLayout Grid.Row="1"
                     Orientation="Horizontal"
                     HorizontalOptions="Center">
            <Button Text="Search Maps"
              Clicked="ShowSearchUI"/>
            <Button Text="My Maps"
              Clicked="GetMyMaps"/>
        </StackLayout>
  </Grid>
</ContentPage>


In this topic
  1. Code