Bing Imagery

This sample demonstrates using the ESRI.ArcGIS.Client.Toolkit.Bing TileLayer to display map imagery from Microsoft's Bing services. Click on the radio buttons to change the various Bing map styles to different enumerations (like: Road, Aerial and ArielWithLabels).

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.BingImagery"
    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"
    xmlns:bing="clr-namespace:ESRI.ArcGIS.Client.Bing;assembly=ESRI.ArcGIS.Client.Bing">
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <Style x:Key="Link_Button" TargetType="Button">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <TextBlock TextDecorations="Underline"> 
								<ContentPresenter/>
                            </TextBlock>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Foreground" Value="Blue" />
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="true">
                        <Setter Property="Foreground" Value="Red" />
                    </Trigger>
                </Style.Triggers>
            </Style>
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <esri:Map x:Name="MyMap" WrapAround="True" Background="#FFE3E3E3"/>
        <esri:Attribution Layers="{Binding ElementName=MyMap, Path=Layers}" Margin="10" VerticalAlignment="Top" />
        <Grid Name="BingKeyGrid" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,15,0">
            <Rectangle Stroke="Gray"  RadiusX="10" RadiusY="10" Fill="{StaticResource PanelGradient}" Margin="0,0,0,5" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10" />
            <StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="20,20,20,20">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="2" >
                    <TextBlock FontWeight="Bold" HorizontalAlignment="Center" Text="Enter Bing Key" Margin="2" Foreground="Black" />
                    <Button Style="{StaticResource Link_Button}" Margin="2" Content="(Get Bing Key)" Click="Button_Click"/>
                </StackPanel>
                <TextBox x:Name="BingKeyTextBox" Width="250" HorizontalAlignment="Right" Margin="0,2,0,2" 
                        TextChanged="BingKeyTextBox_TextChanged" />
                <TextBlock Name="InvalidBingKeyTextBlock" Text="Invalid Key" Foreground="Red"
                        Margin="0,2,0,2" HorizontalAlignment="Center" Visibility="Collapsed"/>
                <Button Name="LoadMapButton" Content="Load Map" Width="100" Margin="0,5,0,10" IsEnabled="False" 
                        HorizontalAlignment="Center" Click="LoadMapButton_Click" />
            </StackPanel>
        </Grid>
        <Grid Name="LayerStyleGrid" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="10" Visibility="Collapsed" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="5" >
                <RadioButton x:Name="RoadRadioButton" 
                         Tag="Road" IsChecked="true" Margin="5,0,0,0" Foreground="White"
                         GroupName="Layers" Content="Road" Click="RadioButton_Click"/>
                <RadioButton x:Name="AerialRadioButton" 
                         Tag="Aerial" Margin="5,0,0,0" Foreground="White" 
                         GroupName="Layers" Content="Aerial" Click="RadioButton_Click"/>
                <RadioButton x:Name="AerialWithLabelsRadioButton" 
                         Tag="AerialWithLabels" Margin="5,0,0,0" Foreground="White" 
                         GroupName="Layers" Content="Aerial - Labels" Click="RadioButton_Click"/>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014