This sample illustrates how to use the Attribution control to
display copyright information for local layers in the map.
Download Sample Application
<UserControl x:Class="ArcGISWPFSDK.LocalAttribution"
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 x:Name="LayoutRoot" Background="White">
<Grid.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</Grid.Resources>
<esri:Map x:Name="MyMap" Extent="-15000000,2000000,-7000000,8000000" Background="#FFE3E3E3" MinimumResolution="2445.98490512499">
<esri:ArcGISLocalTiledLayer ID="myBaseMap" Path="..\\Data\\TPKs\\Topographic.tpk"/>
<esri:ArcGISLocalDynamicMapServiceLayer Path="..\\Data\\MPKS\\USCitiesStates.mpk"/>
</esri:Map>
<esri:Attribution Layers="{Binding ElementName=MyMap, Path=Layers}" Margin="10" VerticalAlignment="Bottom" Foreground="Black"/>
<ProgressBar x:Name="MyProgressBar" IsIndeterminate="True" VerticalAlignment="Bottom" Width="200" Height="20" Margin="10" Visibility="{Binding Path=IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
</Grid>
</UserControl>
using System.Windows.Controls;
using System.ComponentModel;
namespace ArcGISWPFSDK
{
public partial class LocalAttribution : UserControl, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private bool _isBusy = true;
public bool IsBusy
{
get
{
return _isBusy;
}
set
{
_isBusy = value;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("IsBusy"));
}
}
}
public LocalAttribution()
{
InitializeComponent();
DataContext = this;
MyMap.Layers.LayersInitialized += (o, evt) =>
{
IsBusy = false;
};
}
}
}
Imports System.Windows.Controls
Imports System.ComponentModel
Namespace ArcGISWPFSDK
Partial Public Class LocalAttribution
Inherits UserControl
Implements INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Private _isBusy As Boolean = True
Public Property IsBusy() As Boolean
Get
Return _isBusy
End Get
Set(value As Boolean)
_isBusy = value
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("IsBusy"))
End Set
End Property
Public Sub New()
InitializeComponent()
AddHandler MyMap.Layers.LayersInitialized, AddressOf map_LayersInitialized
End Sub
Private Sub map_LayersInitialized(sender As Object, e As EventArgs)
DataContext = Me
IsBusy = False
End Sub
End Class
End Namespace
5/16/2014