Note: This API is now obsolete. Please use the ScaleLine control in the ESRI.ArcGIS.Client.Toolkit namespace.
Gets or sets the color of the text that is displayed on the ScaleBar Control to denote the current scale.
Visual Basic (Declaration) | |
---|---|
Public Property TextColor As Brush |
C# | |
---|---|
public Brush TextColor {get; set;} |
The following image depicts what part of the ScaleBar is impacted by the TextColor Property:
TextColor considerations:
The default TextColor is White.
If the ScaleBar Control is sitting on an area of the SilverLight/WPF application where the background is also White, it will appear that no text is displayed. Change the TextColor to a color that contrasts with the background Silverlight/WPF application where the ScaleBar sits and the text will be revealed.
XAML | Copy Code |
---|---|
<esri:ScaleBar Name="ScaleBar1" Map="{Binding ElementName=Map1}" MapUnit="DecimalDegrees" DisplayUnit="Miles" TextColor="Black" FontFamily="Courier New" FontSize="18" /> |
C# | Copy Code |
---|---|
//Using the existing ScaleBar1 Control that was defined previously //Bind to a Map Control ScaleBar1.Map = Map1; //Set the Map and Display units for the ScaleBar ScaleBar1.MapUnit = ESRI.ArcGIS.Client.ScaleBarUnit.DecimalDegrees; ScaleBar1.DisplayUnit = ESRI.ArcGIS.Client.ScaleBarUnit.Miles; //Set TextColor and related Font information System.Windows.Media.Color myTextColor = Color.FromArgb(255, 0, 0, 0); //Black ScaleBar1.TextColor = new System.Windows.Media.SolidColorBrush(myTextColor); ScaleBar1.FontFamily = new FontFamily("Courier New"); ScaleBar1.FontSize = 18; |
VB.NET | Copy Code |
---|---|
Using the existing ScaleBar1 Control that was defined previously 'Bind to a Map Control ScaleBar1.Map = Map1 'Set the Map and Display units for the ScaleBar ScaleBar1.MapUnit = ESRI.ArcGIS.Client.ScaleBarUnit.DecimalDegrees ScaleBar1.DisplayUnit = ESRI.ArcGIS.Client.ScaleBarUnit.Miles 'Set TextColor and related Font information Dim myTextColor As System.Windows.Media.Color = Color.FromArgb(255, 0, 0, 0) 'Black ScaleBar1.TextColor = New System.Windows.Media.SolidColorBrush(myTextColor) ScaleBar1.FontFamily = New FontFamily("Courier New") ScaleBar1.FontSize = 18 |
Target Platforms:Windows Phone 7