2012-07-26 67 views
0

我在我的表單上有一個Bing地圖控件,這個地圖包含了很多圖釘。如何在Bing地圖控件中添加信息框?

當我點擊圖釘時,我想顯示一個信息框。

那麼如何添加此信息框?

請參閱bellow image.i必須重新查詢此類型的信息框。 enter image description here

回答

0

這裏是一個示例代碼。所有你需要做的是一個點擊事件附加到圖釘

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"); 
    } 
} 

enter image description here

+0

你是對的Bragboy.But我想信息框不是一個消息框,因爲我有多個圖釘。而且這個所有圖釘都是自動播放所以消息框是不可能的信息框不可能在wp7中?請儘快幫助我並給予答覆。 – Mansinh 2012-07-27 04:09:17

+0

@Mansinh:你的信息框是什麼意思?看看這裏着名的coding4fun庫支持的各種提示windows phone - http://coding4fun.codeplex.com/(Sroll到底部查看截圖) – bragboy 2012-07-27 07:41:38

+0

:請看我上傳的圖片。讓我重播 – Mansinh 2012-07-27 12:16:12

0

是的,我得到了什麼,你說 你只要把圖像按鈕在所有geocoordination 從您更換圖釘在當任何按鈕按下按鈕 並動態地改變每個點的圖釘內容