Rendering with code

This sample demonstrates dynamic construction of class breaks renderers in code. In the sample, controls are provided for users to control how class breaks are constructed.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocalThematic_Interactive"
    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">
        <Grid.Resources>
            <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" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000" Background="#FFE3E3E3" MinimumResolution="2445.98490512499">
            <esri:ArcGISLocalTiledLayer ID="myBaseMap" Path="..\\Data\\TPKs\\Topographic.tpk"/>
            <esri:GraphicsLayer ID="MyGraphicsLayer" />
        </esri:Map>
        <StackPanel Orientation="Vertical" Margin="15" HorizontalAlignment="Left" VerticalAlignment="Top" >
            <Grid x:Name="LegendGrid" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="10,10,10,10" >
                <Path x:Name="LegendCollapsedTriangle" Canvas.ZIndex="100" Height="10" HorizontalAlignment="Right" Margin="0,19,15.375,0" VerticalAlignment="Top" 
                      Width="10" Fill="#995C90B2" Stretch="Fill" Stroke="#FF666666" Data="M85,25 L85,25 L87.5,30 L90,25 z" 
                      RenderTransformOrigin="3.083,-1.417" Visibility="Collapsed" StrokeThickness="0"/>
                <Path x:Name="LegendExpandedTriangle" Canvas.ZIndex="100" Height="10" HorizontalAlignment="Right" Margin="0,16.931,15.294,0" VerticalAlignment="Top" Width="10" Stretch="Fill" 
                      Stroke="#FF666666" Data="M85,30 L85,30 L87.5,25 L90,30 z" RenderTransformOrigin="3.083,-1.417" 
                      Fill="#995C90B2" StrokeThickness="0"/>
                <Rectangle RadiusX="10" RadiusY="10" Fill="#22000000" Margin="0,4,0,0" />
                <Rectangle Stroke="Gray"  RadiusX="10" RadiusY="10" Fill="{StaticResource PanelGradient}" Margin="0,0,0,5" />
                <Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
                <TextBlock x:Name="LegendCollapsedTitle" TextAlignment="Center" Text="Legend" Margin="30.331,15.069,29.669,0" FontWeight="Bold" Foreground="Black" Height="16" 
                           VerticalAlignment="Top" RenderTransformOrigin="0.501,1.017" Visibility="Collapsed" />
                <StackPanel Orientation="Vertical" Margin="25" HorizontalAlignment="Center" VerticalAlignment="Top" >
                    <TextBlock x:Name="LegendTitle" HorizontalAlignment="Center" TextAlignment="Center" Text="Legend" Margin="5" FontWeight="Bold" Foreground="Black"/>
                    <StackPanel x:Name="LegendStackPanel" HorizontalAlignment="Center" Margin="5" />
                </StackPanel>
            </Grid>
        </StackPanel>
        <StackPanel Orientation="Vertical" Margin="15" HorizontalAlignment="Right" VerticalAlignment="Top" >
            <Grid x:Name="ClassGrid" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" >
                <Path x:Name="ClassCollapsedTriangle" Canvas.ZIndex="100" Height="10" HorizontalAlignment="Right" Margin="0,19,15.375,0" VerticalAlignment="Top" Width="10" Fill="#995C90B2" 
                      Stretch="Fill" Stroke="#FF666666" Data="M85,25 L85,25 L87.5,30 L90,25 z" RenderTransformOrigin="3.083,-1.417" Visibility="Collapsed" 
                      StrokeThickness="0"/>
                <Path x:Name="ClassExpandedTriangle" Canvas.ZIndex="100" Height="10" HorizontalAlignment="Right" Margin="0,16.931,15.294,0" VerticalAlignment="Top" Width="10" Stretch="Fill" 
                      Stroke="#FF666666" Data="M85,30 L85,30 L87.5,25 L90,30 z" RenderTransformOrigin="3.083,-1.417" Fill="#995C90B2" 
                      StrokeThickness="0"/>
                <Rectangle Fill="#22000000" RadiusX="10" RadiusY="10" Margin="0,4,0,0" />
                <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5" />
                <Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
                <TextBlock x:Name="ClassCollapsedTitle" TextAlignment="Center" Text="Thematic Properties" Margin="30.331,15.069,29.669,0" FontWeight="Bold" 
                           Height="16" VerticalAlignment="Top" RenderTransformOrigin="0.501,1.017" Visibility="Collapsed" Foreground="Black" />
                <StackPanel Orientation="Vertical" Margin="25" HorizontalAlignment="Center" VerticalAlignment="Top">
                    <TextBlock HorizontalAlignment="Center" TextAlignment="Center" Text="Thematic Properties" Margin="5" FontWeight="Bold" Foreground="Black"/>
                    <TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Theme:" Margin="0,5,0,0" Foreground="Black"  />
                    <ComboBox x:Name="FieldCombo" HorizontalAlignment="Left" SelectionChanged="FieldCombo_SelectionChanged" MaxWidth="200" Width="150"/>
                    <TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Classes:" Margin="0,5,0,0" Foreground="Black" />
                    <ComboBox x:Name="ClassCountCombo" HorizontalAlignment="Left" SelectionChanged="ClassCountCombo_SelectionChanged" SelectedIndex="0" >
                        <ComboBoxItem Content="6" Tag="6" />
                        <ComboBoxItem Content="5" Tag="5" />
                        <ComboBoxItem Content="4" Tag="4" />
                        <ComboBoxItem Content="3" Tag="3" />
                    </ComboBox>
                    <TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Classification Type:" Margin="0,5,0,0" Foreground="Black"  />
                    <ComboBox x:Name="ClassTypeCombo" HorizontalAlignment="Left" SelectionChanged="ClassTypeCombo_SelectionChanged" SelectedIndex="0" >
                        <ComboBoxItem Content="Quantile" />
                        <ComboBoxItem Content="Equal Interval" />
                    </ComboBox>
                    <TextBlock HorizontalAlignment="Left" TextAlignment="Center" Text="Color Theme:" Margin="0,5,0,0" Foreground="Black"  />
                    <ComboBox x:Name="ColorBlendCombo" HorizontalAlignment="Left" SelectionChanged="ColorBlendCombo_SelectionChanged"  SelectedIndex="0" >
                        <ComboBoxItem Content="Blue" Background="Blue" />
                        <ComboBoxItem Content="Red" Background="Red" />
                        <ComboBoxItem Content="Green" Background="Green" />
                        <ComboBoxItem Content="Yellow" Background="Yellow" />
                        <ComboBoxItem Content="Magenta" Background="Magenta" />
                        <ComboBoxItem Content="Cyan" Background="Cyan" />
                        <ComboBoxItem Content="MultiColor" />
                    </ComboBox>
                    <Button x:Name="RenderButton" IsEnabled="False" Content="Render " Click="RenderButton_Click" Width="100" Margin="0,5,0,0" />
                </StackPanel>
            </Grid>
        </StackPanel>
    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014