Event-based Asynchronous Pattern (EAP) with Inline Lambdas

This sample demonstrates using the Event-based Asynchronous Pattern (EAP) with inline lambdas for a QueryTask on local data.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocalEventBasedAsyncLambda"
    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/client/2009">
    <Grid>
    <Grid.Resources>
        <esri:SimpleFillSymbol x:Key="RedFillSymbol"
                                   Fill="#66FF0000"
                                   BorderBrush="Red"
                                   BorderThickness="2" />
        <esri:SimpleRenderer x:Key="FillRenderer"
                                 Symbol="{StaticResource RedFillSymbol}" />
    </Grid.Resources>
        <esri:Map x:Name="MyMap" UseAcceleratedDisplay="True" WrapAround="True" Background="#FFE3E3E3">
            <esri:ArcGISLocalTiledLayer ID="BaseMap" Path="..\Data\TPKs\Topographic.tpk"/>
            <esri:GraphicsLayer ID="MyGraphics"
                                Renderer="{StaticResource FillRenderer}"/>
    </esri:Map>
        <Border HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,133,0" Padding="5" Background="White" 
                BorderBrush="Black" BorderThickness="1" Width="229">
            <Border.Effect>
                <DropShadowEffect />
            </Border.Effect>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Left" 
                    Width="330" Height="50" Margin="5">
                <Button x:Name="button1"  Content="QueryTask using Event Based Async" Margin="5" Width="199" Click="Button_Click_1" IsEnabled="False"/>       
            </StackPanel>
        </Border>
    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014