<esri:Legend x:Name="Legend" Grid.Row="1" Background="Transparent" HorizontalContentAlignment="Stretch" BorderThickness="0" LayerItemsMode="Tree" MinWidth="{TemplateBinding MinContentWidth}" ShowOnlyVisibleLayers="False"> <esri:Legend.MapLayerTemplate> <DataTemplate> <StackPanel Margin="1" Orientation="Horizontal"> <local:GrayableCheckBox IsChecked="{Binding IsEnabled, Mode=TwoWay}" VerticalAlignment="Center" IsGrayed="{Binding IsInScaleRange, Converter={StaticResource InverseBoolConverter}}" ToolTipService.ToolTip="Toggle Service Visibility" /> <TextBlock Text="{Binding Label}" Margin="2,0,0,0" VerticalAlignment="Center"> <ToolTipService.ToolTip> <ToolTip> <ToolTip.Visibility> <PriorityBinding> <Binding Path="Layer.Description" Converter="{StaticResource StringVisibilityConverter}" IsAsync="True" Mode="OneWay" /> <Binding Path="Layer.LayerInfo.Description" Converter="{StaticResource StringVisibilityConverter}" IsAsync="True" Mode="OneWay" /> </PriorityBinding> </ToolTip.Visibility> <StackPanel MaxWidth="400" > <TextBlock TextWrapping="Wrap" Margin="1,1,1,6"> <TextBlock.Text> <PriorityBinding> <Binding Path="Layer.Description" IsAsync="True" Mode="OneWay" /> <Binding Path="Layer.LayerInfo.Description" IsAsync="True" Mode="OneWay" /> </PriorityBinding> </TextBlock.Text> </TextBlock> <TextBlock FontWeight="Bold" TextWrapping="Wrap"> <TextBlock.Text> <PriorityBinding> <Binding Path="Layer.CopyrightText" IsAsync="True" Mode="OneWay" /> <Binding Path="Layer.LayerInfo.CopyrightText" IsAsync="True" Mode="OneWay" /> </PriorityBinding> </TextBlock.Text> </TextBlock> </StackPanel> </ToolTip> </ToolTipService.ToolTip> </TextBlock> <Image Source="/SDL.ArcGIS.Client.Toolkit;component/Table Of Contents/Images/Time.png" Visibility="{Binding Layer.TimeExtent, Converter={StaticResource TimeExtentVisibilityConverter}, FallbackValue='Collapsed'}" ToolTip="Layer Is Time Aware" Width="12" Height="12" Margin="2,0,0,0" /> <Slider Minimum="0" Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="60" ToolTipService.ToolTip="Set Layer Transparency" HorizontalAlignment="Right" Margin="2,0,0,0" /> </StackPanel> </DataTemplate> </esri:Legend.MapLayerTemplate>
Sorry for all the posts about the Legend control...
I really like the control
I can just get this from "Layer.CopyrightText" in the xaml
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.