Simple Renderer

This sample demonstrates the dynamic layers functionality of the ArcGIS Runtime by overriding the default renderers for the Cities, Highways and States feature layers (originally defined within ArcGIS for Desktop) with new renderers 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 SimpleRenderer to each feature layer independently with the apppriate symbol type for the layer's geometry being automatically selected in each case: SimpleMarkerSymbol, SimpleLineSymbol or SimpleFillSymbol. The symbol colors, thickness, and type are randomly generated by means of two utility functions which either create a random Color or a random enumeration value.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.DynamicLayersSimpleRenderer"
             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="200">
                <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="80">
                        <Rectangle Height="80" Width="190" RadiusX="5" RadiusY="5" Fill="#DDFFFFFF" Stroke="DarkGray"/>
                        <StackPanel>
                            <TextBlock Text="Cities:" Foreground="Black" Margin="5,5,5,5"/>
                            <Button x:Name="ChangeCitiesRendererButton" Content="Change Cities Renderer" Foreground="Black" 
                            Margin="5,0,5,5" Width="180" Click="ChangeCitiesRendererButton_Click" />
                            <Button x:Name="ResetCitiesRendererButton" Content="Reset Cities Renderer" Foreground="Black" 
                            Margin="5,0,5,5" Width="180" Click="ResetCitiesRendererButton_Click" />
                        </StackPanel>
                    </Canvas>
                    <Canvas Margin="5,0,5,5" Height="80">
                        <Rectangle Height="80" Width="190" RadiusX="5" RadiusY="5" Fill="#DDFFFFFF" Stroke="DarkGray"/>
                        <StackPanel>
                            <TextBlock Text="Highways:" Foreground="Black" Margin="5,5,5,5"/>
                            <Button x:Name="ChangeHighwaysRendererButton" Content="Change Highways Renderer" Foreground="Black" 
                             Margin="5,0,5,5" Width="180" Click="ChangeHighwaysRendererButton_Click" />
                            <Button x:Name="ResetHighwaysRendererButton" Content="Reset Highways Renderer" Foreground="Black" 
                            Margin="5,0,5,5" Width="180" Click="ResetHighwaysRendererButton_Click" />
                        </StackPanel>
                    </Canvas>
                    <Canvas Margin="5,0,5,5" Height="80">
                        <Rectangle Height="80" Width="190" RadiusX="5" RadiusY="5" Fill="#DDFFFFFF" Stroke="DarkGray"/>
                        <StackPanel>
                            <TextBlock Text="States:" Foreground="Black" Margin="5,5,5,5"/>
                            <Button x:Name="ChangeStatesRendererButton" Content="Change States Renderer" Foreground="Black" 
                            Margin="5,0,5,5" Width="180" Click="ChangeStatesRendererButton_Click" />
                            <Button x:Name="ResetStatesRendererButton" Content="Reset States Renderer" Foreground="Black" 
                            Margin="5,0,5,5" Width="180" Click="ResetStatesRendererButton_Click" />
                        </StackPanel>
                    </Canvas>
                    <Canvas Margin="5,0,5,10" Height="30">
                        <Rectangle Height="30" Width="190" RadiusX="5" RadiusY="5" Fill="#DDFFFFFF" Stroke="DarkGray"/>
                        <StackPanel>
                            <Button x:Name="ResetAllRenderersButton" Content="Reset All Renderers" Foreground="Black" 
                            Margin="5,5,5,5" Width="180" Click="ResetAllRenderersButton_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