Windows phone 7 如何切换图钉的显示/隐藏状态';Bing地图、Windows Phone中的信息框?

Windows phone 7 如何切换图钉的显示/隐藏状态';Bing地图、Windows Phone中的信息框?,windows-phone-7,toggle,bing-maps,pushpin,infobox,Windows Phone 7,Toggle,Bing Maps,Pushpin,Infobox,这是一个简单的应用程序。它显示基于数据绑定的动态多个图钉 当用户点击图钉时,信息框将显示在上面,如图所示 当用户再次点击图钉时。信息框将折叠 如果用户点击地图上任何不是图钉的区域。所有图钉的信息框都将折叠 二是,;点击infobox时,它将导航到该位置的详细信息页面 这是我的资源区 <phone:PhoneApplicationPage.Resources> <ControlTemplate x:Key="currentPushPin" TargetType="my:

这是一个简单的应用程序。它显示基于数据绑定的动态多个图钉

当用户点击图钉时,信息框将显示在上面,如图所示

当用户再次点击图钉时。信息框将折叠

如果用户点击地图上任何不是图钉的区域。所有图钉的信息框都将折叠

二是,;点击infobox时,它将导航到该位置的详细信息页面

这是我的资源区

<phone:PhoneApplicationPage.Resources>
    <ControlTemplate x:Key="currentPushPin" TargetType="my:Pushpin">
        <Grid x:Name="ContentGrid"
           Width="58"
           Height="76"
           Margin="0">
            <Image Source="images/currentPin.png" Stretch="Fill"/>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="normalPushPin" TargetType="my:Pushpin">
        <StackPanel>
            <ContentPresenter x:Name="content" HorizontalAlignment="Center"/>
            <Path Data="M0,0 L0,1 L1,0"
                        Fill="Black" Stretch="Fill" Margin="15,0" Height="12"
                                Width="18" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent},
                                Path=Content.Visibility, Mode=TwoWay}" HorizontalAlignment="Left" />
            <Image Source="images/Pin.png" Stretch="None" HorizontalAlignment="Left"/>
        </StackPanel>
    </ControlTemplate>

    <DataTemplate x:Key="LogoTemplate">
        <my:Pushpin Background="#FFB6DE2E" Location="{Binding location}" Tap="Pushpin_Tap">
            <my:Pushpin.Content>
                <Border Background="Black" Width="130" Visibility="Collapsed" x:Name="border"  HorizontalAlignment="Center" >
                    <StackPanel>
                        <TextBlock TextAlignment="Center" Text="{Binding title}"/>
                    </StackPanel>
                </Border>
            </my:Pushpin.Content>
        </my:Pushpin>
    </DataTemplate>
</phone:PhoneApplicationPage.Resources>

谢谢

我知道这已经很晚了,但为了给有类似问题的人省去一些痛苦- 看看


它可能会给你一些关于如何继续的指导。

我也对这个很感兴趣。
<my:Map ZoomLevel="10"  Margin="0,-21,0,0" Name="myMap" CredentialsProvider="AsbJ8nhHrawCJNpgYLyPRSunojuLOKcZtMj_ZUEgEGW5dSsczqrQHDZwbi0i2bFY" Tap="map_Tap">
            <my:Pushpin Name="currentPin" Template="{StaticResource currentPushPin}" Margin="0,-22,0,0">
            </my:Pushpin>
            <my:MapItemsControl ItemTemplate="{StaticResource LogoTemplate}" ItemsSource="{Binding PushpinCollection}" >
            </my:MapItemsControl>
        </my:Map>
//Event Handler for pushpins
    private void Pushpin_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    {
        //What I should write here?
    }


    private void map_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    {
        //What I should write here?
    }