2015-11-25 1 views
0

Comment changer la couleur de la légende dans le code derrière Silverlight:Modifier la légende couleur et la police en utilisant la Sillverlight sur la carte esri

<esri:Map x:Name="Map" Background="White" Loaded="Map_Loaded" WrapAround="True" Grid.ColumnSpan="3" 
           MouseClick="Map_MouseClick" > 
         <esri:ArcGISDynamicMapServiceLayer x:Name="gisdynamic" ID="gisdynamic" 
         Url="http://192.168.10.1:6080/arcgis/rest/services/babolsar/Babolsar10/MapServer" 
         DisplayName="نقشه بابلسر" DisableClientCaching="true" Initialized="Map_Initialized" InitializationFailed="layer_InitializationFailed" 
         DynamicLayerInfos="{x:Null}" ImageFormat="PNG24" LayerDrawingOptions="{x:Null}" ProxyURL="{x:Null}" /> 

         <esri:GraphicsLayer ShowLegend="false" ID="ResultsGraphicsLayer" /> 
         <esri:GraphicsLayer ShowLegend="false" ID="MyGraphicsLayer" /> 
         <esri:GraphicsLayer ShowLegend="false" ID="MySelectionGraphicsLayer" MouseEnter="GraphicsLayer_MouseEnter" MouseLeave="GraphicsLayer_MouseLeave"/> 
         <esri:GraphicsLayer ShowLegend="false" ID="IdentifyIconGraphicsLayer"/> 

<esri:Legend Name="Legend" HorizontalAlignment="Left" Background="White" Foreground="White" 
           `enter code here` VerticalAlignment="Top" Margin="0,0,0,0" Width="300" 
           Map="{Binding ElementName=Map}" 
            LayerItemsMode="Tree" ShowOnlyVisibleLayers="false" Refreshed="Legend_Refreshed"> 
         <esri:Legend.MapLayerTemplate> 
          <DataTemplate> 
           <StackPanel Orientation="Horizontal"> 
            <CheckBox Content="{Binding Label}" 
              IsChecked="{Binding IsEnabled, Mode=TwoWay}" 
              IsEnabled="{Binding IsInScaleRange}" > 
            </CheckBox> 
            <Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="100" /> 
           </StackPanel> 
          </DataTemplate> 
         </esri:Legend.MapLayerTemplate> 
         <esri:Legend.LayerTemplate> 
          <DataTemplate> 
           <CheckBox Content="{Binding Label}" 
            IsChecked="{Binding IsEnabled, Mode=TwoWay}" 
            IsEnabled="{Binding IsInScaleRange}" > 
           </CheckBox> 
          </DataTemplate> 
         </esri:Legend.LayerTemplate> 
        </esri:Legend> 

Répondre