Statistical query

This sample demonstrates how to query a feature table to get statistics for a specified field.

Query statistics for features in the map

Instructions

Check the appropriate boxes to filter features by attributes and/or within the current extent. Click the button to see basic statistics displayed for world cities.

Code

<UserControl 
    x:Class="ArcGISRuntime.UWP.Samples.StatisticalQuery.StatisticalQuery"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid>
        <esriUI:MapView x:Name="MyMapView" Grid.Column="1"/>
        <CommandBar>
            <AppBarButton Content="Statistics"
                          Width="120">
                <AppBarButton.Flyout>
                    <Flyout>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <CheckBox x:Name="OnlyInExtentCheckbox"
                                      Grid.Row="0"
                                      Content="Cities in current extent"/>
                            <CheckBox x:Name="OnlyBigCitiesCheckbox"
                                      Grid.Row="1"
                                      Content="Cities larger than 5M"/>
                            <ListBox x:Name="StatResultsListBox"
                                      Grid.Row="2"
                                      HorizontalAlignment="Stretch"
                                      Margin="5"
                                      Height="200"/>
                            <Button x:Name="GetStatsButton"
                                      Grid.Row="3"
                                      Height="30"
                                      Margin="10"
                                      Content="Get Statistics"
                                      Click="OnExecuteStatisticsQueryClicked"/>
                        </Grid>
                    </Flyout>
                </AppBarButton.Flyout>
            </AppBarButton>
        </CommandBar>
    </Grid>
</UserControl>


In this topic
  1. Instructions
  2. Code