Click or drag to resize
DynamicLayerInfoCollection Class
A collection of DynamicLayerInfo used with the ArcGISDynamicMapServiceLayer.
Inheritance Hierarchy
SystemObject
  System.Collections.ObjectModelCollectionDynamicLayerInfo
    System.Collections.ObjectModelObservableCollectionDynamicLayerInfo
      Esri.ArcGISRuntime.LayersDynamicLayerInfoCollection

Namespace: Esri.ArcGISRuntime.Layers
Assembly: Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 10.2.7.0 (10.2.7.1234)
Syntax
public class DynamicLayerInfoCollection : ObservableCollection<DynamicLayerInfo>

The DynamicLayerInfoCollection type exposes the following members.

Constructors
Methods
  NameDescription
Public methodAdd (Inherited from CollectionDynamicLayerInfo.)
Protected methodBlockReentrancy
Disallows reentrant attempts to change this collection.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Protected methodCheckReentrancy
Checks for reentrant attempts to change this collection.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Public methodClear (Inherited from CollectionDynamicLayerInfo.)
Protected methodClearItems
Clears the items.
(Overrides ObservableCollectionTClearItems.)
Public methodContains (Inherited from CollectionDynamicLayerInfo.)
Public methodCopyTo (Inherited from CollectionDynamicLayerInfo.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetEnumerator (Inherited from CollectionDynamicLayerInfo.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf (Inherited from CollectionDynamicLayerInfo.)
Public methodInsert (Inherited from CollectionDynamicLayerInfo.)
Protected methodInsertItem
Inserts an item into the collection at the specified index.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMove
Moves the item at the specified index to a new location in the collection.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Protected methodMoveItem
Moves the item at the specified index to a new location in the collection.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Protected methodOnCollectionChanged
Raises the CollectionChanged event.
(Overrides ObservableCollectionTOnCollectionChanged(NotifyCollectionChangedEventArgs).)
Protected methodOnPropertyChanged
Raises the PropertyChanged event with the provided arguments.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Public methodRemove (Inherited from CollectionDynamicLayerInfo.)
Public methodRemoveAt (Inherited from CollectionDynamicLayerInfo.)
Protected methodRemoveItem
Removes the item at the specified index of the collection.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Protected methodSetItem
Replaces the element at the specified index.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyCount (Inherited from CollectionDynamicLayerInfo.)
Public propertyItem
Gets or sets the element at the specified index.
(Inherited from CollectionDynamicLayerInfo.)
Protected propertyItems (Inherited from CollectionDynamicLayerInfo.)
Top
Events
  NameDescription
Public eventCollectionChanged
Occurs when an item is added, removed, changed, moved, or the entire list is refreshed.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Protected eventPropertyChanged
Occurs when a property value changes.
(Inherited from ObservableCollectionDynamicLayerInfo.)
Top
Remarks

Dynamic Layers allow the execution of various ArcGIS Server requests from a client application. An in-depth discussion about Dynamic Layers is in the Fundamentals document: Dynamic Layers. The client side requests that can be issued to ArcGIS Server include the ability to:

  • Change the rendering of an existing ArcGISDynamicMapServiceLayer.
  • Create a layer on-the-fly for the Workspace Types of: Database, Shapefile, FileGDB, and Raster.
  • Perform table joins.
  • Query for specific records.
  • Identify features.
  • Return raster images.

Dynamic Layers are new in ArcGIS Server v10.1.

The key to creating a Dynamic Layer is to set the DynamicLayerInfo.Source Property to the appropriate LayerSource object. The LayerSource is an Abstract Class and has two inherited Classes that should be used in setting the DynamicLayerInfo.Source, they are: LayerDataSource and LayerMapSource. One DynamicLayerInfo object is used per Dynamic Layer and is added to a DynamicLayerInfoCollection which is set to the ArcGISDynamicMapServiceLayer.DynamicLayerInfos Property. By default, an ArcGISDynamicMapServiceLayer that was created in ArcMap and served up via ArcGIS Server has its DynamicLayerInfoCollection being empty (meaning Nothing/null). Developers can use the ArcGISDynamicMapServiceLayer.CreateDynamicLayerInfosFromLayerInfos Method to populate the DynamicLayerInfoCollection to serve as a starting point for creating a Dynamic Layer or they can create individual DynamicLayerInfo objects from scratch and add them to the DynamicLayerInfoCollection.

The collection of DynamicLayerInfo objects is used to change the Layer ordering or to redefine the Dynamic Layers drawn in the Map. The order of the objects in the DynamicLayerInfoCollection defines the Layer drawing order; specifically the first element of the collection draws on top of all other Layers.

NOTE: Because creating and using Dynamic Layers requires ArcGIS Server v10.1 and higher, use the ArcGISDynamicMapServiceLayer.ServiceInfo Property to obtain a MapServiceInfo object. Then check that the MapServiceInfo.SupportsDynamicLayers Property = True to ensure that these conditions have been met.

Examples

Demonstrates using various Renderers on a Dynamic Layer when the 'WorkspaceID' and 'DataSourceName' are known using a TableDataSource.

Code example using the DynamicLayerInfoCollection Class.

XAML
<Window x:Class="DynamicLayerInfoCollection.MainWindow"
        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/runtime/2013"
        Title="MainWindow" Height="600" Width="800">
    <Grid x:Name="LayoutRoot">

        <!-- Add a MapView Control. -->
        <esri:MapView x:Name="MapView1" Background="White" HorizontalAlignment="Left" Margin="0,110,0,0"
                      VerticalAlignment="Top" Height="444" Width="782">

            <!-- Add a Map. -->
            <esri:Map x:Name="Map1">

                <!-- Add a backdrop ArcGISTiledMapServiceLayer. The SpatialReference is 4326 (lat/long). -->
                <esri:ArcGISTiledMapServiceLayer ID="myArcGISTiledMapServiceLayer" 
                ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />

            </esri:Map>
        </esri:MapView>

        <!-- 
        Button to add a Dynamic Layer (using a TableDataSource Type of LayerDataSource) via code-behind. 
        Users choose a different RadioButton to see the Rendering effect on the Dynamic Layer.
        -->
        <RadioButton Content="SimpleRenderer" Height="16" HorizontalAlignment="Left" Margin="12,60,0,0" 
               Name="RadioButton_SimpleRenderer" VerticalAlignment="Top" IsChecked="True"/>
        <RadioButton Content="ClassBreaksRenderer" Height="16" HorizontalAlignment="Left" Margin="160,60,0,0" 
               Name="RadioButton_ClassBreaksRenderer" VerticalAlignment="Top" />
        <RadioButton Content="UniqueValueRenderer" Height="16" HorizontalAlignment="Left" Margin="330,60,0,0" 
               Name="RadioButton_UniqueValueRenderer" VerticalAlignment="Top" />
        <Button Content="Add a LayerDataSource based Dynamic Layer using the specified Renderer" Height="24" 
          HorizontalAlignment="Left" Margin="0,81,0,0" Name="Button1" VerticalAlignment="Top" Width="782" 
          Click="Button1_Click"/>

        <!-- Add a TextBlock to hold the instructions on how to use the sample code. -->
        <TextBlock Height="55" HorizontalAlignment="Left" Name="TextBlock1" VerticalAlignment="Top" Width="772" 
           TextWrapping="Wrap" Margin="10,0,0,0"/>

    </Grid>
</Window>

SPECIAL NOTE: The XAML displayed above comes from a C# project. If you are a VB.NET developer, you will need to modify the text for the x:Class namespace from "DynamicLayerInfoCollection.MainWindow" to be just "MainWindow".

namespace DynamicLayerInfoCollection
{
    public partial class MainWindow : System.Windows.Window
    {
        public MainWindow()
        {
            InitializeComponent();

            // Add the instructions on how to use this example code to the TextBlock.
            TextBlock1.Text = "Choose a desired Renderer and click the Button to create a Dynamic Layer on-the-fly " + 
                "using code-behind. You can repeat this process for each Renderer to see the different effect. Examples of the " + 
                "'WorkspaceID' and 'DataSourceName' are provided as comments in the code-behind for a public ArcGIS Server that " + 
                "has Dynamic Layers enabled via the LayerDataSource object.";

            // Zoom to the continental US.
            Esri.ArcGISRuntime.Geometry.Envelope myExtent;
            myExtent = new Esri.ArcGISRuntime.Geometry.Envelope(-133.12, 13.68, -26.63, 60.93);
            Map1.InitialViewpoint = new Esri.ArcGISRuntime.Controls.Viewpoint(myExtent);
        }

        private void Button1_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            // Add a Layer on-the-fly based on an ArcGISDynamicMapServiceLayer that has Dynamic Layer capabilities enabled.
            // The Dynamic Layer is being generated uses the 'Workspace Type' of 'Database' via the LayerDataSource object. Review the
            // ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer Class documentation in the API reference for a full discussion.
            // In order to create this Dynamic Layer, information was shared between the Manager/Administrator of the
            // ArcGISDynamicMapServiceLayer ArcGIS Server service and the application developer.
            // 
            // The Url for the ArcGISDynamicMapServiceLayer is: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer".
            // 
            // The WorkspaceID used in the LayerDataSource for the Dynamic Layer is: "MyDatabaseWorkspaceIDSSR2"
            // 
            // There are several DataSourceName types associated with the WorkspaceID that could be used to create the Rendering 
            // of a Dynamic Layer. Think of the DataSourceName as the string name of the layer that will be drawn dynamically.
            // A listing of the available DataSourceNames (and their geometry type) are:
            // "ss6.gdb.highways" <== Polylines
            // "ss6.gdb.states" <== Polygons
            // "ss6.gdb.counties" <== Polygons
            // "ss6.gdb.cities" <== Points
            // "ss6.gdb.lakes" <== Polygons
            // "ss6.gdb.places" <== Points
            // "ss6.gdb.rivers" <== Polylines
            // "ss6.gdb.urbanareas" <== Polygons
            // "ss6.gdb.railroads" <== Polylines

            // Create a new TableDataSource object and set it's .WorkspaceID and .DataSourceName Properties to valid values.
            Esri.ArcGISRuntime.Layers.TableDataSource myTableDataSource = new Esri.ArcGISRuntime.Layers.TableDataSource();
            myTableDataSource.WorkspaceID = "MyDatabaseWorkspaceIDSSR2";
            myTableDataSource.DataSourceName = "ss6.gdb.states";

            // Create a new LayerDataSource and set its DataSource Property to the TableDataSource.
            Esri.ArcGISRuntime.Layers.LayerDataSource myLayerDataSource = new Esri.ArcGISRuntime.Layers.LayerDataSource();
            myLayerDataSource.DataSource = myTableDataSource;

            // Create a new DynamicLayerInfo object and set its ID and Source Properties.
            Esri.ArcGISRuntime.Layers.DynamicLayerInfo myDynamicLayerInfo = new Esri.ArcGISRuntime.Layers.DynamicLayerInfo();
            myDynamicLayerInfo.ID = 99; // Must be the same as the LayerDrawingOptions.LayerID
            myDynamicLayerInfo.Source = myLayerDataSource;

            // Create a new DynamicLayerInfoCollection and add the DynamicLayerInfo object into it.
            Esri.ArcGISRuntime.Layers.DynamicLayerInfoCollection myDynamicLayerInfoCollection = new Esri.ArcGISRuntime.Layers.DynamicLayerInfoCollection();
            myDynamicLayerInfoCollection.Add(myDynamicLayerInfo);

            // Create a new LayerDrawingOptions object which is key to applying our custom Rendering of the Dynamic Layer.
            // It is imperative that the LayerDrawingOptions.LayerID = DynamicLayerInfo.ID so that the Dynamic Layer draws
            // using the new symbology.
            Esri.ArcGISRuntime.Layers.LayerDrawingOptions myLayerDrawingOptions = new Esri.ArcGISRuntime.Layers.LayerDrawingOptions();
            myLayerDrawingOptions.LayerID = 99; // Must be the same as the DynammicLayerInfo.ID

            // Set the Renderer of the Dynamic Layer based upon the user choice from the RadioButtons in the GUI.
            if (RadioButton_SimpleRenderer.IsChecked == true)
            {
                // Use a SimpleRenderer.
                myLayerDrawingOptions.Renderer = MakeSimpleRendererFill();
            }
            else if (RadioButton_ClassBreaksRenderer.IsChecked == true)
            {
                // Use a ClassBreaksRenderer. Specify the string name of the Field that Rendering will occur on.
                myLayerDrawingOptions.Renderer = MakeClassBreaksRenderer_Fill("pop2000");
            }
            else if (RadioButton_UniqueValueRenderer.IsChecked == true)
            {
                // Use a UniqueValueRenderer. Specify the string name of the Field that Rendering will occur on.
                myLayerDrawingOptions.Renderer = MakeUniqueValueRenderer_Fill("sub_region");
            }

            // Create a new LayerDrawinOptionsCollection and add the LayerDraingOptions object into it.
            Esri.ArcGISRuntime.Layers.LayerDrawingOptionCollection myLayerDrawingOptionsCollection = new Esri.ArcGISRuntime.Layers.LayerDrawingOptionCollection();
            myLayerDrawingOptionsCollection.Add(myLayerDrawingOptions);

            // Create a new Dynamic Layer that is based upon on a LayerDataSource of an ArcGISDynamicMapServiceLayer
            // and apply it's custom rendering.
            Esri.ArcGISRuntime.Layers.ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer = new Esri.ArcGISRuntime.Layers.ArcGISDynamicMapServiceLayer();
            myArcGISDynamicMapServiceLayer.ServiceUri = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer";
            myArcGISDynamicMapServiceLayer.DynamicLayerInfos = myDynamicLayerInfoCollection;
            myArcGISDynamicMapServiceLayer.LayerDrawingOptions = myLayerDrawingOptionsCollection;

            // Add the Dynamic Layer to the Map. This causes the round trip server request to occur.
            MapView1.Map.Layers.Add(myArcGISDynamicMapServiceLayer);
        }

        public Esri.ArcGISRuntime.Symbology.SimpleRenderer MakeSimpleRendererFill()
        {
            // Create a SimpleFillSymbol that is a red fill with a black outline.
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol.Color = System.Windows.Media.Colors.Red;
            Esri.ArcGISRuntime.Symbology.SimpleLineSymbol mySimpleLineSymbol = new Esri.ArcGISRuntime.Symbology.SimpleLineSymbol();
            mySimpleLineSymbol.Color = System.Windows.Media.Colors.Black;
            mySimpleLineSymbol.Style = Esri.ArcGISRuntime.Symbology.SimpleLineStyle.Solid;
            mySimpleLineSymbol.Width = 1;
            mySimpleFillSymbol.Outline = mySimpleLineSymbol;

            // Create a new SimpleRenderer based upon the SimpleFillSymbol.
            Esri.ArcGISRuntime.Symbology.SimpleRenderer mySimpleRenderer = new Esri.ArcGISRuntime.Symbology.SimpleRenderer();
            mySimpleRenderer.Symbol = mySimpleFillSymbol;

            return mySimpleRenderer;
        }

        public Esri.ArcGISRuntime.Symbology.ClassBreaksRenderer MakeClassBreaksRenderer_Fill(string theFieldName)
        {
            // Create a ClassBreaksRenderer using what is specified for theFieldName as the Field to 
            // perform the Rendering. In our case the various ClassBreakInfo objects have hard-coded 
            // .MinimumValue and .MaximumValue settings that are appropriate for the .Field. If you
            // use a different DataSourceName you will need to adjust these values accordingly.
            Esri.ArcGISRuntime.Symbology.ClassBreaksRenderer myClassBreaksRenderer = new Esri.ArcGISRuntime.Symbology.ClassBreaksRenderer();
            myClassBreaksRenderer.Field = theFieldName; // Requires a numeric Field

            // Define the outline Symbol for the Fills
            Esri.ArcGISRuntime.Symbology.SimpleLineSymbol myBlackSolidOutline = new Esri.ArcGISRuntime.Symbology.SimpleLineSymbol();
            myBlackSolidOutline.Color = System.Windows.Media.Colors.Black;
            myBlackSolidOutline.Style = Esri.ArcGISRuntime.Symbology.SimpleLineStyle.Solid;
            myBlackSolidOutline.Width = 1;

            // Group #1
            Esri.ArcGISRuntime.Symbology.ClassBreakInfo myClassBreakInfo1 = new Esri.ArcGISRuntime.Symbology.ClassBreakInfo();
            myClassBreakInfo1.Minimum = 0;
            myClassBreakInfo1.Maximum = 1000000;
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol1 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol1.Color = System.Windows.Media.Colors.Yellow;
            mySimpleFillSymbol1.Outline = myBlackSolidOutline;
            mySimpleFillSymbol1.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myClassBreakInfo1.Symbol = mySimpleFillSymbol1;
            myClassBreaksRenderer.Infos.Add(myClassBreakInfo1);

            // Group #2
            Esri.ArcGISRuntime.Symbology.ClassBreakInfo myClassBreakInfo2 = new Esri.ArcGISRuntime.Symbology.ClassBreakInfo();
            myClassBreakInfo2.Minimum = 1000001;
            myClassBreakInfo2.Maximum = 10000000;
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol2 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol2.Color = System.Windows.Media.Colors.Green;
            mySimpleFillSymbol2.Outline = myBlackSolidOutline;
            mySimpleFillSymbol2.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myClassBreakInfo2.Symbol = mySimpleFillSymbol2;
            myClassBreaksRenderer.Infos.Add(myClassBreakInfo2);

            // Group #3
            Esri.ArcGISRuntime.Symbology.ClassBreakInfo myClassBreakInfo3 = new Esri.ArcGISRuntime.Symbology.ClassBreakInfo();
            myClassBreakInfo3.Minimum = 10000001;
            myClassBreakInfo3.Maximum = 100000000;
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol3 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol3.Color = System.Windows.Media.Colors.Red;
            mySimpleFillSymbol3.Outline = myBlackSolidOutline;
            mySimpleFillSymbol3.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myClassBreakInfo3.Symbol = mySimpleFillSymbol3;
            myClassBreaksRenderer.Infos.Add(myClassBreakInfo3);

            return myClassBreaksRenderer;
        }

        public Esri.ArcGISRuntime.Symbology.UniqueValueRenderer MakeUniqueValueRenderer_Fill(string theFieldName)
        {
            // Create a UniqueValueRenderer using what is specified for theFieldName as the Field to 
            // perform the Rendering. In our case the various UniqueValueInfo objects have hard-coded 
            // .Value settings that are appropriate for the .Field. If you use a different 
            // DataSourceName you will need to adjust these values accordingly.
            Esri.ArcGISRuntime.Symbology.UniqueValueRenderer myUniqueValueRenderer = new Esri.ArcGISRuntime.Symbology.UniqueValueRenderer();
            myUniqueValueRenderer.Fields.Add(theFieldName);

            // Define the outline Symbol for the Fills
            Esri.ArcGISRuntime.Symbology.SimpleLineSymbol myBlackSolidOutline = new Esri.ArcGISRuntime.Symbology.SimpleLineSymbol();
            myBlackSolidOutline.Color = System.Windows.Media.Colors.Black;
            myBlackSolidOutline.Style = Esri.ArcGISRuntime.Symbology.SimpleLineStyle.Solid;
            myBlackSolidOutline.Width = 1;

            // Group #1
            Esri.ArcGISRuntime.Symbology.UniqueValueInfo myUniqueValueInfo1 = new Esri.ArcGISRuntime.Symbology.UniqueValueInfo();
            myUniqueValueInfo1.Values.Add("Pacific");
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol1 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol1.Color = System.Windows.Media.Colors.Yellow;
            mySimpleFillSymbol1.Outline = myBlackSolidOutline;
            mySimpleFillSymbol1.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myUniqueValueInfo1.Symbol = mySimpleFillSymbol1;
            myUniqueValueRenderer.Infos.Add(myUniqueValueInfo1);

            // Group #2
            Esri.ArcGISRuntime.Symbology.UniqueValueInfo myUniqueValueInfo2 = new Esri.ArcGISRuntime.Symbology.UniqueValueInfo();
            myUniqueValueInfo2.Values.Add("W N Cen");
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol2 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol2.Color = System.Windows.Media.Colors.Blue;
            mySimpleFillSymbol2.Outline = myBlackSolidOutline;
            mySimpleFillSymbol2.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myUniqueValueInfo2.Symbol = mySimpleFillSymbol2;
            myUniqueValueRenderer.Infos.Add(myUniqueValueInfo2);

            // Group #3
            Esri.ArcGISRuntime.Symbology.UniqueValueInfo myUniqueValueInfo3 = new Esri.ArcGISRuntime.Symbology.UniqueValueInfo();
            myUniqueValueInfo3.Values.Add("W S Cen");
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol3 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol3.Color = System.Windows.Media.Colors.Red;
            mySimpleFillSymbol3.Outline = myBlackSolidOutline;
            mySimpleFillSymbol3.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myUniqueValueInfo3.Symbol = mySimpleFillSymbol3;
            myUniqueValueRenderer.Infos.Add(myUniqueValueInfo3);

            // Group #4
            Esri.ArcGISRuntime.Symbology.UniqueValueInfo myUniqueValueInfo4 = new Esri.ArcGISRuntime.Symbology.UniqueValueInfo();
            myUniqueValueInfo4.Values.Add("E N Cen");
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol4 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol4.Color = System.Windows.Media.Colors.White;
            mySimpleFillSymbol4.Outline = myBlackSolidOutline;
            mySimpleFillSymbol4.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myUniqueValueInfo4.Symbol = mySimpleFillSymbol4;
            myUniqueValueRenderer.Infos.Add(myUniqueValueInfo4);

            // Group #5
            Esri.ArcGISRuntime.Symbology.UniqueValueInfo myUniqueValueInfo5 = new Esri.ArcGISRuntime.Symbology.UniqueValueInfo();
            myUniqueValueInfo5.Values.Add("Mtn");
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol5 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol5.Color = System.Windows.Media.Colors.Brown;
            mySimpleFillSymbol5.Outline = myBlackSolidOutline;
            mySimpleFillSymbol5.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myUniqueValueInfo5.Symbol = mySimpleFillSymbol5;
            myUniqueValueRenderer.Infos.Add(myUniqueValueInfo5);

            // Group #6
            Esri.ArcGISRuntime.Symbology.UniqueValueInfo myUniqueValueInfo6 = new Esri.ArcGISRuntime.Symbology.UniqueValueInfo();
            myUniqueValueInfo6.Values.Add("N Eng");
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol6 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol6.Color = System.Windows.Media.Colors.Cyan;
            mySimpleFillSymbol6.Outline = myBlackSolidOutline;
            mySimpleFillSymbol6.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myUniqueValueInfo6.Symbol = mySimpleFillSymbol6;
            myUniqueValueRenderer.Infos.Add(myUniqueValueInfo6);

            // Group #7
            Esri.ArcGISRuntime.Symbology.UniqueValueInfo myUniqueValueInfo7 = new Esri.ArcGISRuntime.Symbology.UniqueValueInfo();
            myUniqueValueInfo7.Values.Add("E S Cen");
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol7 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol7.Color = System.Windows.Media.Colors.Green;
            mySimpleFillSymbol7.Outline = myBlackSolidOutline;
            mySimpleFillSymbol7.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myUniqueValueInfo7.Symbol = mySimpleFillSymbol7;
            myUniqueValueRenderer.Infos.Add(myUniqueValueInfo7);

            // Group #8
            Esri.ArcGISRuntime.Symbology.UniqueValueInfo myUniqueValueInfo8 = new Esri.ArcGISRuntime.Symbology.UniqueValueInfo();
            myUniqueValueInfo8.Values.Add("Mid Atl");
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol8 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol8.Color = System.Windows.Media.Colors.Gray;
            mySimpleFillSymbol8.Outline = myBlackSolidOutline;
            mySimpleFillSymbol8.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myUniqueValueInfo8.Symbol = mySimpleFillSymbol8;
            myUniqueValueRenderer.Infos.Add(myUniqueValueInfo8);

            // Group #9
            Esri.ArcGISRuntime.Symbology.UniqueValueInfo myUniqueValueInfo9 = new Esri.ArcGISRuntime.Symbology.UniqueValueInfo();
            myUniqueValueInfo9.Values.Add("S Atl");
            Esri.ArcGISRuntime.Symbology.SimpleFillSymbol mySimpleFillSymbol9 = new Esri.ArcGISRuntime.Symbology.SimpleFillSymbol();
            mySimpleFillSymbol9.Color = System.Windows.Media.Colors.Orange;
            mySimpleFillSymbol9.Outline = myBlackSolidOutline;
            mySimpleFillSymbol9.Style = Esri.ArcGISRuntime.Symbology.SimpleFillStyle.Solid;
            myUniqueValueInfo9.Symbol = mySimpleFillSymbol9;
            myUniqueValueRenderer.Infos.Add(myUniqueValueInfo9);

            return myUniqueValueRenderer;
        }

    }
}
See Also
Supported Platforms
This type is supported on the following ArcGIS Runtime .NET SDK platforms:
Windows Desktop
Windows Phone
Windows Store
Additional Examples
Hyperlink to ExampleDescription
CreateDynamicLayerInfosFromLayerInfosDemonstrates applying a custom rendering via XAML using the Dynamic Layer option of an ArcGISDynamicMapServiceLayer. Also, shows how to use the ArcGISDynamicMapServiceLayer.CreateDynamicLayerInfosFromLayerInfos Method to obtain the original rendering of the layer that was defined in the map service. The CreateDynamicLayerInfosFromLayerInfos is then used to reset the layer back to orignal rendering.
DynamicLayerInfoCollectionDemonstrates using various Renderers on a Dynamic Layer when the 'WorkspaceID' and 'DataSourceName' are known using a TableDataSource.
DynamicLayerInfosDemonstrates using various Renderers on a Dynamic Layer (via XAML and code-behind) when the 'WorkspaceID' and 'DataSourceName' are known using a TableDataSource.
IdentifyParameter_DynamicLayerInfosDemonstrates performing an Identify on a Dynamic Layer using the ESRI.ArcGISRuntime.Tasks.Query.IdentifyParameter.DynamicLayerInfos Property.
LayerDrawingOptionCollectionDemonstrates using the existing rendering of a Dynamic Layer sub-layer of an ArcGISDynamicMapServiceLayer and switching to a custom rendering defined in code-behind for the Dynamic Layer.
LayerDrawingOptionsDemonstrates changing the rendering of the first sub-layer of an ArcGISDynamicMapServiceLayer using the Dynamic Layer capabilities of ArcGIS Server 10.1 and higher.
QueryTableDataSourceDemonstrates adding a Dynamic Layer via code-behind using a QueryTableDataSource.