Contour

This sample demonstrates using the Contour geoprocessing tool to creates a feature class of contours (isolines) from local raster data. To use the sample, specify a interval, then click on the generate button. The contour lines will be returned and drawn on the map. This sample demonstrates an asynchronous geoprocessing operation whereby the result is returned as a map service or added to the graphics layer depending on the number of features returned. When less than 100 features are returned the result is added to the graphics layer and when there are more than 100 features returned the results are displayed as a map service to improve performance.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocalContour"
    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 x:Name="LayoutRoot" Background="White">
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <esri:SimpleLineSymbol x:Key="ResultsLineSymbol" Color="Red" Width="2" />
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <esri:Map x:Name="MyMap" Background="Gray" Extent="471060.082572495,231352.353396819,494700.082572495,208312.353396819">
            <esri:ArcGISLocalTiledLayer ID="arcGISLocalTiledLayer" Path="..\\Data\\TPKs\\RasterHillshade.tpk"/>
            <esri:GraphicsLayer ID="MyResultGraphicsLayer" />
        </esri:Map>
        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,15,0" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5">
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="5,5,5,10" />
            <StackPanel Orientation="Vertical" Margin="10,10,10,10" HorizontalAlignment="Left" >
                <TextBlock Text="Spatial Analyst Contour tool" HorizontalAlignment="Center" FontWeight="Bold" Foreground="Black"
                           Margin="5,5,5,5" Height="17" Width="251" />
                <TextBlock x:Name="InformationTextBlock" Text="Specify the interval, or distance, between contour lines and click the Generate Contours button."
                    Width="253" TextWrapping="Wrap" Foreground="Black" Height="50" />
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="5,5,5,10">
                    <TextBlock Text="Interval: " VerticalAlignment="Center" Foreground="Black" />
                    <TextBox x:Name="IntervalTextBox" Text="500" Width="35" TextAlignment="Right" Margin="0,0,5,0" />
                    <Button x:Name="GenerateButton" Content="Generate Results" Click="GenerateButton_Click" IsEnabled="False" />
                    <Button x:Name="ClearButton" Content="Clear Results" Click="ClearButton_Click" IsEnabled="false" Margin="5,0,0,0"/>
                </StackPanel>
                <TextBlock x:Name="ProcessingTextBlock" MaxWidth="150" Margin="0,0,0,5" Visibility="Collapsed" 
                           HorizontalAlignment="Center" Text="Processing." TextWrapping="Wrap" Foreground="Black" />
            </StackPanel>
        </Grid>
        <ProgressBar x:Name="MyProgressBar" IsIndeterminate="True" VerticalAlignment="Bottom" Width="200" Height="20" Margin="10" Visibility="{Binding Path=IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
    </Grid>
</UserControl>
Sample code usage restrictions
5/16/2014