Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 7 如何在windows phone7 Bing地图中单击图钉时显示信息框?_Windows Phone 7 - Fatal编程技术网

Windows phone 7 如何在windows phone7 Bing地图中单击图钉时显示信息框?

Windows phone 7 如何在windows phone7 Bing地图中单击图钉时显示信息框?,windows-phone-7,Windows Phone 7,我正在WP7中开发Bing地图应用程序,它从数据库中提取pin数据,在地图上显示pin。但是如何用与pin相关的数据填充。请告诉我如何在WP7中显示自定义信息框。如果有任何示例,请告诉我。请参阅下面的示例,希望您获得解决方案 public partial class MainPage : PhoneApplicationPage { public MainPage() { InitializeComponent(); InitPage();

我正在WP7中开发Bing地图应用程序,它从数据库中提取pin数据,在地图上显示pin。但是如何用与pin相关的数据填充。请告诉我如何在WP7中显示自定义信息框。如果有任何示例,请告诉我。

请参阅下面的示例,希望您获得解决方案

public partial class MainPage : PhoneApplicationPage
{
    public MainPage()
    {
        InitializeComponent();
        InitPage();
    }

    private void InitPage()
    {
        testMap.Center = new GeoCoordinate(42,42);
        testMap.ZoomLevel = 10;

        MapLayer pushPinLayer = new MapLayer();
        testMap.Children.Add(pushPinLayer);

        Pushpin pushpin = new Pushpin();

        pushpin.Tap += new EventHandler<GestureEventArgs>(pushpin_Tap);

        pushpin.Content = "SAMPLE";
        pushPinLayer.AddChild(pushpin, new GeoCoordinate(42, 42));

    }

    void pushpin_Tap(object sender, GestureEventArgs e)
    {
        MessageBox.Show("You Clicked here");
    }
public部分类主页:PhoneApplicationPage
{
公共主页()
{
初始化组件();
InitPage();
}
私有void InitPage()
{
testMap.Center=新的地理坐标(42,42);
testMap.ZoomLevel=10;
MapLayer pushPinLayer=新的MapLayer();
testMap.Children.Add(pushPinLayer);
图钉图钉=新图钉();
pushpin.Tap+=新事件处理程序(pushpin\u Tap);
pushpin.Content=“示例”;
pushPinLayer.AddChild(pushpin,新地理坐标(42,42));
}
无效图钉点击(对象发送器,手势事件参数e)
{
Show(“你点击这里”);
}
}