Class Breaks Renderer

This sample demonstrates the dynamic layers functionality of the ArcGIS Runtime by overriding the default renderers for the Cities and States feature layers (originally defined within ArcGIS for Desktop) with new ClassBreaksRenderers defined via the ArcGIS Runtime client API. Crucially, this new rendering information is applied at the "server" level when rendering the map image. The user interface controls allow you to apply a new ClassBreaksRenderer to one feature layer at a time with the apppriate symbol type for the layer's geometry type being automatically used in each case. The Classification Method can also be selected from a list of enumeration values: Equal Interval; Natrual Breaks; Quantile; and Standard Deviation. The number of Class Breaks can be chosen from a drop down list. Each of these properties will be used when defining a new ClassBreaksDefinition to submit to the GenerateDataClassesTask. This task returns a new Renderer based on the supplied parameters.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.DynamicLayersClassBreaksRenderer"
             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>
            <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" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <esri:Map x:Name="_mapControl" Background="#FFE3E3E3">
        </esri:Map>
        <StackPanel Orientation="Vertical" Margin="10" HorizontalAlignment="Right" VerticalAlignment="Top">
            <Grid x:Name="DynamicLayersUiGrid" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,5,0" Width="170">
                <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray" Margin="0,0,0,5">
                    <Rectangle.Effect>
                        <DropShadowEffect/>
                    </Rectangle.Effect>
                </Rectangle>
                <StackPanel Orientation="Vertical" VerticalAlignment="Top">
                    <Canvas Margin="5,5,5,5" Height="240">
                        <Rectangle Height="235" Width="160" RadiusX="5" RadiusY="5" Fill="#DDFFFFFF" Stroke="DarkGray"/>
                        <StackPanel>
                            <TextBlock Text="Layer:" Margin="5,5,5,5"/>
                            <RadioButton x:Name="_citiesRadioButton" Checked="radioButton_Checked" Margin="10,0,10,5">
                                Cities (Population 2000)
                            </RadioButton>
                            <RadioButton x:Name="_statesRadioButton" Checked="radioButton_Checked" Margin="10,0,10,5" >
                                States (Population 2000)</RadioButton>
                            <TextBlock Text="Classification Method:" Margin="5,5,5,5"/>
                            <ComboBox x:Name="classificationMethodComboBox" SelectedIndex="0" Margin="0,0,5,5" Width="145">
                                <ComboBoxItem>EqualInterval</ComboBoxItem>
                                <ComboBoxItem>NaturalBreaks</ComboBoxItem>
                                <ComboBoxItem>Quantile</ComboBoxItem>
                                <ComboBoxItem>StandardDeviation</ComboBoxItem>
                            </ComboBox>
                            <TextBlock Text="Number of Class Breaks:" Margin="5,5,5,5"/>
                            <ComboBox x:Name="classBreaksComboBox" Height="20" Width="145" Margin="0,0,5,5" HorizontalContentAlignment="Right">
                                <ComboBoxItem>2</ComboBoxItem>
                                <ComboBoxItem>3</ComboBoxItem>
                                <ComboBoxItem>4</ComboBoxItem>
                                <ComboBoxItem IsSelected="True">5</ComboBoxItem>
                                <ComboBoxItem>6</ComboBoxItem>
                                <ComboBoxItem>7</ComboBoxItem>
                                <ComboBoxItem>8</ComboBoxItem>
                                <ComboBoxItem>9</ComboBoxItem>
                            </ComboBox>
                            <Button x:Name="ChangeRendererButton" Content="Change Renderer" 
                            Margin="5,5,10,5" Width="150" Click="ChangeRendererButton_Click"/>
                            <Button x:Name="ResetSelectedRendererButton" Content="Reset Selected Renderer"
                                Margin="5,0,10,10" Width="150" Click="ResetSelectedRendererButton_Click" />
                        </StackPanel>
                    </Canvas>
                </StackPanel>
            </Grid>
        </StackPanel>
        <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