Feature layer definition expression

This sample demonstrates how to apply definition expression to a feature layer for filtering features. It also shows how to reset the definition expression.

FeatureLayer with definition expression

Code

<UserControl 
    x:Class="ArcGISRuntime.WPF.Samples.FeatureLayerDefinitionExpression.FeatureLayerDefinitionExpression"
    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="300" d:DesignWidth="300">
    <Grid>
        <esri:MapView Name="MyMapView">
        </esri:MapView>
        <Border Background="White" Margin="20" Padding="20" VerticalAlignment="Top" HorizontalAlignment="Right">
            <WrapPanel HorizontalAlignment="Right">
                <Button Content="Apply Expression"	                
		                Margin="10,10,0,0"
                        Padding="4"
		                VerticalAlignment="Top"
		                Width="Auto"
		                Click="OnApplyExpressionClicked"/>
                <Button Content="Reset Expression"
		                Margin="10,10,0,0"
                        Padding="4"    
		                VerticalAlignment="Top"
		                Width="Auto"
		                Click="OnResetButtonClicked"/>
            </WrapPanel>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code