Dynamic Layers Generate Renderers Online

This sample demonstrates using the GenerateRendererTask to create a class breaks or a unique value renderer on the server without having to retrieve all the data to the client. To use the sample, click either the Generate Range Values or Generate Unique Values button. This updates the renderer on the map.

In the code-behind, a GenerateRendererTask is used to create a renderer, and the LayerDrawingOptions.Renderer is set to the GenerateRendererResultEventArgs.GenerateRendererResult.Renderer to use the generated renderer in the map's display.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.GenerateRenderer"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.Resources>          
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>           
            <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"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.184"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <esri:Map x:Name="MyMap" Background="#FFE3E3E3">
            <esri:Map.Extent>
                <esri:Envelope XMin="-3548912" YMin="-1847469" XMax="2472012" YMax="1742990">
                    <esri:Envelope.SpatialReference>
                        <esri:SpatialReference WKID="102009"/>
                    </esri:Envelope.SpatialReference>
                </esri:Envelope>
            </esri:Map.Extent>
            <esri:ArcGISDynamicMapServiceLayer ID="USA"				
				Url="http://servicesbeta2.esri.com/arcgis/rest/services/Census/MapServer"
                VisibleLayers="2" />
        </esri:Map>
        <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,10,0,10" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray" RadiusX="10" RadiusY="10" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Margin="5" RadiusX="5" RadiusY="5" Fill="#DDFFFFFF" Stroke="DarkGray" Width="150" HorizontalAlignment="Left"/>
            <StackPanel>
            <Button Content="Generate Range Values" Click="GenerateRangeValueClick" Width="140" Height="30" 
                    VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,10,0,5"/>
            <Button Content="Generate Unique Values" Click="GenerateUniqueValueClick" Width="140" Height="30" 
                    VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,0,0,10"/>
            </StackPanel>
        </Grid>
        <ProgressBar x:Name="_progressBar" 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