Solved! Go to Solution.
<Border Background="#77919191" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20" Padding="5" BorderBrush="Black" > <ListBox x:Name="MyList" ItemsSource="{Binding ElementName=MyMap, Path=Layers}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <!--Layer visibility checkbox--> <CheckBox IsChecked="{Binding Visible, Mode=TwoWay}" /> <!--Opacity slider--> <Slider Margin="-5,0,0,0" Minimum="0" Maximum="1" Width="30" Value="{Binding Opacity, Mode=TwoWay}" Height="18" /> <!--Layer name--> <TextBlock Text="{Binding ID, Mode=OneWay}" Margin="5,0,0,0" > <!-- Tooltip on hover--> <ToolTipService.ToolTip> <StackPanel MaxWidth="400"> <TextBlock FontWeight="Bold" Text="{Binding CopyrightText}" TextWrapping="Wrap" /> <TextBlock Text="{Binding Description}" TextWrapping="Wrap" /> </StackPanel> </ToolTipService.ToolTip> </TextBlock> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Border>
</esri:Map>
<UserControl x:Class="SilverlightApplication3.MainPage"
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">
<esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000">
<esri:ArcGISTiledMapServiceLayer ID="StreetLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
</esri:Map>
<Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" >
<Rectangle Fill="#77919191" Stroke="Gray" RadiusX="10" RadiusY="10" Margin="0,0,0,5" >
<Rectangle.Effect>
<DropShadowEffect/>
</Rectangle.Effect>
</Rectangle>
<Rectangle Fill="#66FFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
<Image x:Name="MyMagnifyImage" Source="/Assets/images/magglass.png" Canvas.ZIndex="10" Margin="25, 20, 20, 25"
Stretch="UniformToFill" Width="32" Height="50"
MouseLeftButtonDown="MyMagnifyImage_MouseLeftButtonDown" />
</Grid>
<Canvas>
<esri:Magnifier x:Name="MyMagnifier" ZoomFactor="3" Canvas.ZIndex="10" Map="{Binding ElementName=MyMap}" >
<esri:Magnifier.Layers>
<esri:ArcGISTiledMapServiceLayer ID="MagnifyImageLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" />
</esri:Magnifier.Layers>
</esri:Magnifier>
</Canvas>
</Grid>
</UserControl>
private void MyMagnifyImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { MyMagnifier.Enabled = !MyMagnifier.Enabled; }
public MainPage()
public MainPage() { InitializeComponent(); } private void MyMagnifyImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { MyMagnifier.Enabled = !MyMagnifier.Enabled; }
public partial class LayerList : UserControl { public LayerList() { InitializeComponent(); } }
private void Application_Startup(object sender, StartupEventArgs e) { this.RootVisual = new MainPage(); }
<Border Background="#77919191" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20" Padding="5" BorderBrush="Black" > <ListBox x:Name="MyList" ItemsSource="{Binding ElementName=MyMap, Path=Layers}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <!--Layer visibility checkbox--> <CheckBox IsChecked="{Binding Visible, Mode=TwoWay}" /> <!--Opacity slider--> <Slider Margin="-5,0,0,0" Minimum="0" Maximum="1" Width="30" Value="{Binding Opacity, Mode=TwoWay}" Height="18" /> <!--Layer name--> <TextBlock Text="{Binding ID, Mode=OneWay}" Margin="5,0,0,0" > <!-- Tooltip on hover--> <ToolTipService.ToolTip> <StackPanel MaxWidth="400"> <TextBlock FontWeight="Bold" Text="{Binding CopyrightText}" TextWrapping="Wrap" /> <TextBlock Text="{Binding Description}" TextWrapping="Wrap" /> </StackPanel> </ToolTipService.ToolTip> </TextBlock> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Border>
</esri:Map>