ArcGIS Runtime SDK for .NET Samples

Find place

Find places near the current location
Loading

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.FindPlace.FindPlace"
             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>
        <esri:MapView x:Name="MyMapView" />
        <Border
            Background="White" BorderBrush="Black" BorderThickness="1"
            HorizontalAlignment="Right" VerticalAlignment="Top"
            Margin="30" Padding="20" Width="375">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>
                <TextBlock
                    Text="Enter a search term and a search location. Tap 'Search all' to find all results near that location. Tap 'Search in view' to restrict the search to results within the current visible extent."
                    Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3"
                    TextAlignment="Left" TextWrapping="Wrap" FontWeight="SemiBold" />
                <TextBlock Text="Search"
                           Grid.Row="1" Grid.Column="0"
                           Margin="0,5,5,0" />
                <TextBlock Text="Location"
                           Grid.Row="2" Grid.Column="0"
                           Margin="0,5,5,0" />
                <ComboBox x:Name="MySearchBox"
                          Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
                          Text="Coffee"
                          Margin="0,5,0,0"
                          IsEnabled="False" IsEditable="True"
                          TextBoxBase.TextChanged="MySearchBox_TextChanged" />
                <ComboBox x:Name="MyLocationBox"
                          Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
                          Text="Current Location"
                          Margin="0,5,0,0"
                          IsEditable="True" IsEnabled="False"
                          TextBoxBase.TextChanged="MyLocationBox_TextChanged" />
                <Button x:Name="MySearchButton"
                        Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
                        Content="Search all"
                        IsEnabled="False"
                        Margin="0,5,5,0"
                        Click="MySearchButton_Click" />
                <Button x:Name="MySearchRestrictedButton"
                        Grid.Row="3" Grid.Column="2"
                        Content="Search in view"
                        IsEnabled="False"
                        Margin="5,5,0,0"
                        Click="MySearchRestrictedButton_Click" />
                <ProgressBar x:Name="MyProgressBar"
                             Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3"
                             Visibility="Collapsed" IsIndeterminate="True"
                             Margin="0,5,0,0" Height="20" />
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code