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

Gets the copyright text information of an ArcGIS Server based ArcGISDynamicMapServiceLayer web service.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property CopyrightText As String
C# 
public string CopyrightText {get;}

Example

How to use:

When the ArcGISDynamicMapServiceLayer Initializes the CopyrightText will be automatically populated in the TextBlock.

The XAML code in this example is used in conjunction with the code-behind (C# or VB.NET) to demonstrate the functionality.

The following screen shot corresponds to the code example in this page.

Showing the CopyrightText of an ArcGISDynamicMapServiceLayer.

XAMLCopy Code
<Grid x:Name="LayoutRoot">
  
  <!-- Add a Map Control. Set its Initial Extent to Iowa. -->
  <esri:Map Background="White" HorizontalAlignment="Left" Margin="0,180,0,0" Name="Map1" 
          VerticalAlignment="Top" Height="300" Width="400" Extent="-96.89,39.47,-89.91,44.70">
  
    <!-- Define an ArcGISDynamicMapServiceLayer. -->
    <esri:ArcGISDynamicMapServiceLayer 
          Url="http://sampleserver1.arcgisonline.com:80/arcgis/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer"
          Initialized="ArcGISDynamicMapServiceLayer_Initialized"/>
    
  </esri:Map>
  
  <!-- CopyrightText (Read Only). -->
  <sdk:Label Height="24" HorizontalAlignment="Left" Margin="0,88,0,0" Name="Label_CopyrightText" 
             VerticalAlignment="Top" Width="120" Content="CopyrightText:"/>
  <TextBox Height="69" HorizontalAlignment="Left" Margin="0,105,0,0" Name="TextBox_CopyrightText" 
           VerticalAlignment="Top" Width="400" TextWrapping="Wrap" />
  
  <!-- 
  As an alternative you could bind the ArcGISDynamicMapServiceLayer.CopyrightText directly to the
  TextBox.Text Property and not need to put any code in the code-behind for the 
  ArcGISDynamicMapServiceLayer.Initialized Event.
  -->
  <!--<TextBox Height="69" HorizontalAlignment="Left" Margin="0,105,0,0" Name="TextBox_CopyrightText" TextWrapping="Wrap"
           VerticalAlignment="Top" Width="400" Text="{Binding ElementName=Map1, Path=Layers[0].CopyrightText}"/>-->
  
  <!-- Provide the instructions on how to use the sample code. -->
  <TextBlock Height="52" HorizontalAlignment="Left" Name="TextBlock1" VerticalAlignment="Top" Width="400" 
       TextWrapping="Wrap" Text="When the ArcGISDynamicMapServiceLayer Initializes the CopyrightText
       will be automatically populated in the TextBlock." />
      
</Grid>
C#Copy Code
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, System.EventArgs e)
{
  // Get the first layer in the Map. 
  ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer = null;
  myArcGISDynamicMapServiceLayer = (ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer)(Map1.Layers[0]);
  
  // CopyrightText (Read Only).
  // NOTE: The CopyrightText information is set in the Credits section on the General tab of the Data Frame 
  // Properties dialog in ArcMap.
  TextBox_CopyrightText.Text = myArcGISDynamicMapServiceLayer.CopyrightText;
}
VB.NETCopy Code
Private Sub ArcGISDynamicMapServiceLayer_Initialized(ByVal sender As System.Object, ByVal e As System.EventArgs)
  
  ' Get the first layer in the Map. 
  Dim myArcGISDynamicMapServiceLayer As ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer
  myArcGISDynamicMapServiceLayer = CType(Map1.Layers.Item(0), ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer)
  
  ' CopyrightText (Read Only).
  ' NOTE: The CopyrightText information is set in the Credits section on the General tab of the Data Frame 
  ' Properties dialog in ArcMap.
  TextBox_CopyrightText.Text = myArcGISDynamicMapServiceLayer.CopyrightText
  
End Sub

Remarks

When authoring an ArcGISDynamicMapServiceLayer in ArcMap to publish an ArcGIS Server web service, the CopyrightText information is set in the Credits section on the General tab of the Data Frame Properties dialog. See the following ArcMap screen shot:

Setting the ArcGISDynamicMapServiceLayer.CopyrightText in Credits section of the Data Frame Properties dialog of ArcMap.

Requirements

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

See Also

© ESRI, Inc. All Rights Reserved.