ArcGIS API for WPF - Library Reference
Unit Property
See Also  Example Send comments on this topic
ESRI.ArcGIS.Client Namespace > TimeClassBreaksAger Class : Unit Property

Gets or sets the type of TimeUnit for which the TimeClassBreakInfo.MinimumAge and TimeClassBreakInfo.MaximumAge Properties use to define temporal groupings for aging the symbology of features.

Syntax

Visual Basic (Declaration) 
Public Property Unit As TimeUnit
C# 
public TimeUnit Unit {get; set;}

Example

XAMLCopy Code
<!--
The following two XAML code blocks provide equivalent functionality in applying
a TimeClassBreaksAger as a TemporalRenderer.SymbolAger. The difference between 
the two XAML code blocks is in specifying the TimeClassBreaksAger.Unit Property 
and how that affects creating TimeClassBreakInfo groupings that use of the 
MimimumAge and MaximumAge values.
The Map.TimeExtent.Start = 2000/08/03 00:00:01 UTC and the 
Map.TimeExtent.End = 2000/08/24 00:00:01 UTC
-->
            
<!-- Hours version -->
<esri:TemporalRenderer.SymbolAger>
  <esri:TimeClassBreaksAger Unit="Hours">
     
    <!--
    The MinimumAge = 0.0 is equivalent to the date 2000/08/24 00:00:01 UTC
    The MaximumAge = 48.0 is equivalent to the date 2000/08/22 00:00:01 UTC
    -->
    <esri:TimeClassBreakInfo Color="White" Size="10" MinimumAge="0.0" MaximumAge="48.0"/>
          
    <!--
    The MinimumAge = 48.0 is equivalent to the date 2000/08/22 00:00:01 UTC
    The MaximumAge = 120.0 is equivalent to the date 2000/08/19 00:00:01 UTC
    -->
    <esri:TimeClassBreakInfo Color="Blue" Size="7" MinimumAge="48.0" MaximumAge="120.0"/>
    
    <!--
    The MinimumAge = 120.0 is equivalent to the date 2000/08/19 00:00:01 UTC
    The MaximumAge = 288.0 is equivalent to the date 2000/08/12 00:00:01 UTC
    -->
    <esri:TimeClassBreakInfo Color="Red" Size="5" MinimumAge="120.0" MaximumAge="288.0"/>
    
  </esri:TimeClassBreaksAger>
</esri:TemporalRenderer.SymbolAger>
            
<!-- Days version -->
<esri:TemporalRenderer.SymbolAger>
  <esri:TimeClassBreaksAger Unit="Days">
     
    <!--
    The MinimumAge = 0.0 is equivalent to the date 2000/08/24 00:00:01 UTC
    The MaximumAge = 2.0 is equivalent to the date 2000/08/22 00:00:01 UTC
    -->
    <esri:TimeClassBreakInfo Color="White" Size="10" MinimumAge="0.0" MaximumAge="2.0"/>
    
    <!--
    The MinimumAge = 2.0 is equivalent to the date 2000/08/22 00:00:01 UTC
    The MaximumAge = 5.0 is equivalent to the date 2000/08/19 00:00:01 UTC
    -->
    <esri:TimeClassBreakInfo Color="Blue" Size="7" MinimumAge="2.0" MaximumAge="5.0"/>
      
    <!--
    The MinimumAge = 5.0 is equivalent to the date 2000/08/19 00:00:01 UTC
    The MaximumAge = 12.0 is equivalent to the date 2000/08/12 00:00:01 UTC
    -->
    <esri:TimeClassBreakInfo Color="Red" Size="5" MinimumAge="5.0" MaximumAge="12.0"/>
        
  </esri:TimeClassBreaksAger>
</esri:TemporalRenderer.SymbolAger>
C#Copy Code
// The following two functions (HoursVersion and DaysVersion) provide equivalent functionality in applying
// a TimeClassBreaksAger as a TemporalRenderer.SymbolAger. The difference between the two functions is in
// specifying the TimeClassBreaksAger.Unit Property and how that affects creating TimeClassBreakInfo 
// groupings that use of the MimimumAge and MaximumAge values.
// The Map.TimeExtent.Start = #8/3/2000 12:00:01 AM# and the Map.TimeExtent.End = #8/24/2000 12:00:01 AM#
            
            
public void HoursVersion(ESRI.ArcGIS.Client.TemporalRenderer myTemporalRenderer)
{
            
  // Define the TimeClassBreaksAger and set the Units to Hours.
ESRI.ArcGIS.Client.TimeClassBreaksAger myTimeClassBreaksAger = new ESRI.ArcGIS.Client.TimeClassBreaksAger();
myTimeClassBreaksAger.Unit = ESRI.ArcGIS.Client.TimeUnit.Hours;
            
// 1st grouping. This displays the most recent temporal observations.
ESRI.ArcGIS.Client.TimeClassBreakInfo myTimeClassBreakInfo1 = new ESRI.ArcGIS.Client.TimeClassBreakInfo();
myTimeClassBreakInfo1.Color = Color.FromArgb(255, 255, 255, 255); //White
myTimeClassBreakInfo1.MinimumAge = 0.0; //Equivalent to the date #8/24/2000 12:00:01 AM#
myTimeClassBreakInfo1.MaximumAge = 48.0; //Equivalent to the date #8/22/2000 12:00:01 AM#
myTimeClassBreakInfo1.Size = 10;
myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo1);
            
// 2nd grouping. This displays slightly older temporal observations.
ESRI.ArcGIS.Client.TimeClassBreakInfo myTimeClassBreakInfo2 = new ESRI.ArcGIS.Client.TimeClassBreakInfo();
myTimeClassBreakInfo2.Color = Color.FromArgb(255, 0, 0, 255); //Blue
myTimeClassBreakInfo2.MinimumAge = 48.0; //Equivalent to the date #8/22/2000 12:00:01 AM#
myTimeClassBreakInfo2.MaximumAge = 120.0; //Equivalent to the date #8/19/2000 12:00:01 AM#
myTimeClassBreakInfo2.Size = 7;
myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo2);
            
// 3rd grouping. This displays the even older temporal observations.
ESRI.ArcGIS.Client.TimeClassBreakInfo myTimeClassBreakInfo3 = new ESRI.ArcGIS.Client.TimeClassBreakInfo();
myTimeClassBreakInfo3.Color = Color.FromArgb(255, 255, 0, 0); //Red
myTimeClassBreakInfo3.MinimumAge = 120.0; //Equivalent to the date #8/19/2000 12:00:01 AM#
myTimeClassBreakInfo3.MaximumAge = 288.0; //Equivalent to the date #8/12/2000 12:00:01 AM#
myTimeClassBreakInfo3.Size = 5;
myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo3);
            
// Set the TimeClassBreaksAger as the TemporalRenderer.SymbolAger
myTemporalRenderer.SymbolAger = myTimeClassBreaksAger;
            
}
            
public void DaysVerson(ESRI.ArcGIS.Client.TemporalRenderer myTemporalRenderer)
{
            
// Define the TimeClassBreaksAger and set the Units to Days.
ESRI.ArcGIS.Client.TimeClassBreaksAger myTimeClassBreaksAger = new ESRI.ArcGIS.Client.TimeClassBreaksAger();
myTimeClassBreaksAger.Unit = ESRI.ArcGIS.Client.TimeUnit.Days;
            
// 1st grouping. This displays the most recent temporal observations.
ESRI.ArcGIS.Client.TimeClassBreakInfo myTimeClassBreakInfo1 = new ESRI.ArcGIS.Client.TimeClassBreakInfo();
myTimeClassBreakInfo1.Color = Color.FromArgb(255, 255, 255, 255); //White
myTimeClassBreakInfo1.MinimumAge = 0.0; //Equivalent to the date #8/24/2000 12:00:01 AM#
myTimeClassBreakInfo1.MaximumAge = 2.0; //Equivalent to the date #8/22/2000 12:00:01 AM#
myTimeClassBreakInfo1.Size = 10;
myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo1);
            
// 2nd grouping. This displays slightly older temporal observations.
ESRI.ArcGIS.Client.TimeClassBreakInfo myTimeClassBreakInfo2 = new ESRI.ArcGIS.Client.TimeClassBreakInfo();
myTimeClassBreakInfo2.Color = Color.FromArgb(255, 0, 0, 255); //Blue
myTimeClassBreakInfo2.MinimumAge = 2.0; //Equivalent to the date #8/22/2000 12:00:01 AM#
myTimeClassBreakInfo2.MaximumAge = 5.0; //Equivalent to the date #8/19/2000 12:00:01 AM#
myTimeClassBreakInfo2.Size = 7;
myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo2);
            
// 3rd grouping. This displays the even older temporal observations.
ESRI.ArcGIS.Client.TimeClassBreakInfo myTimeClassBreakInfo3 = new ESRI.ArcGIS.Client.TimeClassBreakInfo();
myTimeClassBreakInfo3.Color = Color.FromArgb(255, 255, 0, 0); //Red
myTimeClassBreakInfo3.MinimumAge = 5.0; //Equivalent to the date #8/19/2000 12:00:01 AM#
myTimeClassBreakInfo3.MaximumAge = 12.0; //Equivalent to the date #8/12/2000 12:00:01 AM#
myTimeClassBreakInfo3.Size = 5;
myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo3);
            
// Set the TimeClassBreaksAger as the TemporalRenderer.SymbolAger
myTemporalRenderer.SymbolAger = myTimeClassBreaksAger;
            
}
VB.NETCopy Code
' The following two functions (HoursVersion and DaysVersion) provide equivalent functionality in applying
' a TimeClassBreaksAger as a TemporalRenderer.SymbolAger. The difference between the two functions is in
' specifying the TimeClassBreaksAger.Unit Property and how that affects creating TimeClassBreakInfo 
' groupings that use of the MimimumAge and MaximumAge values. 
' The Map.TimeExtent.Start = #8/3/2000 12:00:01 AM# and the Map.TimeExtent.End = #8/24/2000 12:00:01 AM#
            
            
Public Sub HoursVersion(ByVal myTemporalRenderer As ESRI.ArcGIS.Client.TemporalRenderer)
            
  ' Define the TimeClassBreaksAger and set the Units to Hours.
  Dim myTimeClassBreaksAger As New ESRI.ArcGIS.Client.TimeClassBreaksAger
  myTimeClassBreaksAger.Unit = ESRI.ArcGIS.Client.TimeUnit.Hours
  
  ' 1st grouping. This displays the most recent temporal observations.
  Dim myTimeClassBreakInfo1 As New ESRI.ArcGIS.Client.TimeClassBreakInfo
  myTimeClassBreakInfo1.Color = Color.FromArgb(255, 255, 255, 255) 'White
  myTimeClassBreakInfo1.MinimumAge = 0.0 'Equivalent to the date #8/24/2000 12:00:01 AM#
  myTimeClassBreakInfo1.MaximumAge = 48.0 'Equivalent to the date #8/22/2000 12:00:01 AM#
  myTimeClassBreakInfo1.Size = 10
  myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo1)
  
  ' 2nd grouping. This displays slightly older temporal observations.
  Dim myTimeClassBreakInfo2 As New ESRI.ArcGIS.Client.TimeClassBreakInfo
  myTimeClassBreakInfo2.Color = Color.FromArgb(255, 0, 0, 255) 'Blue
  myTimeClassBreakInfo2.MinimumAge = 48.0 'Equivalent to the date #8/22/2000 12:00:01 AM#
  myTimeClassBreakInfo2.MaximumAge = 120.0 'Equivalent to the date #8/19/2000 12:00:01 AM#
  myTimeClassBreakInfo2.Size = 7
  myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo2)
  
  ' 3rd grouping. This displays the even older temporal observations.
  Dim myTimeClassBreakInfo3 As New ESRI.ArcGIS.Client.TimeClassBreakInfo
  myTimeClassBreakInfo3.Color = Color.FromArgb(255, 255, 0, 0) 'Red
  myTimeClassBreakInfo3.MinimumAge = 120.0 'Equivalent to the date #8/19/2000 12:00:01 AM#
  myTimeClassBreakInfo3.MaximumAge = 288.0 'Equivalent to the date #8/12/2000 12:00:01 AM#
  myTimeClassBreakInfo3.Size = 5
  myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo3)
  
  ' Set the TimeClassBreaksAger as the TemporalRenderer.SymbolAger
  myTemporalRenderer.SymbolAger = myTimeClassBreaksAger
  
End Sub
  
Public Sub DaysVerson(ByVal myTemporalRenderer As ESRI.ArcGIS.Client.TemporalRenderer)
  
  ' Define the TimeClassBreaksAger and set the Units to Days.
  Dim myTimeClassBreaksAger As New ESRI.ArcGIS.Client.TimeClassBreaksAger
  myTimeClassBreaksAger.Unit = ESRI.ArcGIS.Client.TimeUnit.Days
  
  ' 1st grouping. This displays the most recent temporal observations.
  Dim myTimeClassBreakInfo1 As New ESRI.ArcGIS.Client.TimeClassBreakInfo
  myTimeClassBreakInfo1.Color = Color.FromArgb(255, 255, 255, 255) 'White
  myTimeClassBreakInfo1.MinimumAge = 0.0 'Equivalent to the date #8/24/2000 12:00:01 AM#
  myTimeClassBreakInfo1.MaximumAge = 2.0 'Equivalent to the date #8/22/2000 12:00:01 AM#
  myTimeClassBreakInfo1.Size = 10
  myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo1)
  
  ' 2nd grouping. This displays slightly older temporal observations.
  Dim myTimeClassBreakInfo2 As New ESRI.ArcGIS.Client.TimeClassBreakInfo
  myTimeClassBreakInfo2.Color = Color.FromArgb(255, 0, 0, 255) 'Blue
  myTimeClassBreakInfo2.MinimumAge = 2.0 'Equivalent to the date #8/22/2000 12:00:01 AM#
  myTimeClassBreakInfo2.MaximumAge = 5.0 'Equivalent to the date #8/19/2000 12:00:01 AM#
  myTimeClassBreakInfo2.Size = 7
  myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo2)
  
  ' 3rd grouping. This displays the even older temporal observations.
  Dim myTimeClassBreakInfo3 As New ESRI.ArcGIS.Client.TimeClassBreakInfo
  myTimeClassBreakInfo3.Color = Color.FromArgb(255, 255, 0, 0) 'Red
  myTimeClassBreakInfo3.MinimumAge = 5.0 'Equivalent to the date #8/19/2000 12:00:01 AM#
  myTimeClassBreakInfo3.MaximumAge = 12.0 'Equivalent to the date #8/12/2000 12:00:01 AM#
  myTimeClassBreakInfo3.Size = 5
  myTimeClassBreaksAger.TimeClasses.Add(myTimeClassBreakInfo3)
  
  ' Set the TimeClassBreaksAger as the TemporalRenderer.SymbolAger
  myTemporalRenderer.SymbolAger = myTimeClassBreaksAger
  
End Sub

Remarks

If the Unit Property is not set explicitly in either the code-behind or XAML, then whatever is provided by the ArcGIS Server web service for the temporal dataset will be in used. If creating a custom TimeClassBreaksAger, it is a good programming practice to set the appropriate Unit Property.

The TimeUnit is an Enumeration and has the following possibilities:

  • Days
  • Hours
  • Milliseconds
  • Minutes
  • Months
  • Seconds
  • Weeks
  • Years

To see a full example of how to set and use the Unit Property review the TimeClassBreaksAger Class documentation.

Requirements

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

See Also

© ESRI, Inc. All Rights Reserved.