ArcGIS Runtime SDK for WPF - Library Reference
ClassBreakInfo Class
Members  Example  See Also 
ESRI.ArcGIS.Client Namespace : ClassBreakInfo Class

An object to group (or classify) symbology and class breaks information for a ClassBreaksRenderer.

Object Model

ClassBreakInfo ClassSymbol Class

Syntax

Visual Basic (Declaration) 
Public Class ClassBreakInfo 
   Inherits RendererInfo
   Implements IJsonSerializable 
C# 
public class ClassBreakInfo : RendererInfo, IJsonSerializable  

Remarks

The following image depicts how a Map would look that corresponds to XAML code with a ClassBreaksRenderer defined for a FeatureLayer.

Example of how XAML code using a ClassBreaksRenderer on a FeatureLayer would look visually in the Map.

A ClassBreaksRenderer should have 2 or more ClassBreakInfo objects obtained by the ClassBreaksRenderer.Classes Property. The ClassBreaksRenderer.Classes object is an ObservableCollection of ClassBreakInfo objects that are essenitally classifications (or groupings) used to delineate the different symbology and class breaks information. If just one type of symbology needs to be rendered for a FeatureLayer use a SimpleRenderer instead.

Field.FieldType. The MaximumValue and MinimumValue Properties define the upper and lower values per grouping based upon what the ClassBreaksRenderer.Attribute is set to. To render groups of Strings use the UniqueValueRenderer instead.

Each ClassBreakInfo group needs a RendererInfo.Symbol that visually represents features in the layer that fall between the MinimumValue and MaximumValue.

To see an example of how to set and use ClassBreakInfo objects in a ClassBreaksRenderer review the ClassBreaksRenderer Class documentation.

Example

C#Copy Code
public void ShowClassBreakInfoDetails(ESRI.ArcGIS.Client.ClassBreaksRenderer myClassBreaksRenderer)
{
  // Obtain the ObservableCollection grouping of ClassBreakInfo objects.
  System.Collections.ObjectModel.ObservableCollection<ESRI.ArcGIS.Client.ClassBreakInfo> myObservableCollection = null;
  myObservableCollection = myClassBreaksRenderer.Classes;
                
  // Since the ClassBreaksRenderer.Classes always returns an ObservableCollection, do a test
  // to ensure that at least one grouping exists.
  int count = myObservableCollection.Count;
  if (count > 0)
  {
    // For each ClassBreakInfo grouping in the ObservableCollection obtain all of the
    // relevent information about the group and display in a MessageBox.
    foreach (ESRI.ArcGIS.Client.ClassBreakInfo myClassBreakInfo in myObservableCollection)
    {
      string myDescription = myClassBreakInfo.Description;
      string myLabel = myClassBreakInfo.Label;
      string myMinimumValue = myClassBreakInfo.MinimumValue.ToString();
      string myMaximumValue = myClassBreakInfo.MaximumValue.ToString();
      ESRI.ArcGIS.Client.Symbols.Symbol mySymbol = myClassBreakInfo.Symbol;
      string mySymbolType = mySymbol.GetType().ToString();
    
      MessageBox.Show("ClassBreakInfo Descripton: " + myDescription + System.Environment.NewLine + 
                      "ClassBreakInfo Descripton: " + myLabel + System.Environment.NewLine + 
                      "MinimumValue: " + myMinimumValue + System.Environment.NewLine + 
                      "MaximumValue: " + myMaximumValue + System.Environment.NewLine + 
                      "Symbol Type: " + mySymbolType);
    }
  }
  else
  {
    MessageBox.Show("The ClassBreaksRenderer has no ClassBreakInfo groups defined!");
  }
}
VB.NETCopy Code
Public Sub ShowClassBreakInfoDetails(ByVal myClassBreaksRenderer As ESRI.ArcGIS.Client.ClassBreaksRenderer)
            	
  ' Obtain the ObservableCollection grouping of ClassBreakInfo objects.
  Dim myObservableCollection As Collections.ObjectModel.ObservableCollection(Of ESRI.ArcGIS.Client.ClassBreakInfo)
  myObservableCollection = myClassBreaksRenderer.Classes
  
  ' Since the ClassBreaksRenderer.Classes always returns an ObservableCollection, do a test
  ' to ensure that at least one grouping exists.
  Dim count As Integer = myObservableCollection.Count
  If count > 0 Then
  
    ' For each ClassBreakInfo grouping in the ObservableCollection obtain all of the
    ' relevent information about the group and display in a MessageBox.
    Dim myClassBreakInfo As ESRI.ArcGIS.Client.ClassBreakInfo
    For Each myClassBreakInfo In myObservableCollection
      Dim myDescription As String = myClassBreakInfo.Description
      Dim myLabel As String = myClassBreakInfo.Label
      Dim myMinimumValue As String = myClassBreakInfo.MinimumValue.ToString
      Dim myMaximumValue As String = myClassBreakInfo.MaximumValue.ToString
      Dim mySymbol As ESRI.ArcGIS.Client.Symbols.Symbol = myClassBreakInfo.Symbol
      Dim mySymbolType As String = mySymbol.GetType.ToString
  
      MessageBox.Show("ClassBreakInfo Descripton: " + myDescription + vbCrLf + _
                      "ClassBreakInfo Descripton: " + myLabel + vbCrLf + _
                      "MinimumValue: " + myMinimumValue + vbCrLf + _
                      "MaximumValue: " + myMaximumValue + vbCrLf + _
                      "Symbol Type: " + mySymbolType)
    Next
  Else
    MessageBox.Show("The ClassBreaksRenderer has no ClassBreakInfo groups defined!")
  End If
End Sub

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.Client.RendererInfo
      ESRI.ArcGIS.Client.ClassBreakInfo

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.