开发者

Silverlight - Bing Pushpin on click navigation

I am wanting to add an on click even for a puship pin which will show a pop up windows eg.. Message.Show window.

Also, I want to have an OnCLick navigate too option.

Here is a snippet of my code.

Pushpin 开发者_StackOverflow中文版palmerstonN = new Pushpin();
            palmerstonN.Background = new SolidColorBrush(Colors.Brown);
            palmerstonN.Location = new GeoCoordinate(-40.3541236542693, 175.596991862399);
            palmerstonN.Content = "Arena Manawatu - Palmerston North";



this.map1.Children.Add(palmerstonN);

Any Ideas?


A PushPin has a MouseLeftButtonUp event that you can use to handle a click on the pushping. You could do something like:

Pushpin palmerstonN = new Pushpin();
        palmerstonN.Background = new SolidColorBrush(Colors.Brown);
        palmerstonN.Location = new GeoCoordinate(-40.3541236542693, 175.596991862399);
        palmerstonN.Content = "Arena Manawatu - Palmerston North";
        palmerstonN.MouseLeftButtonUp += new MouseButtonEventHandler(palmerstonN_MouseLeftButtonUp);

this.map1.Children.Add(palmerstonN);
}

void palmerstonN_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    {
        Messabox.Show("My messagebox");
    }

I hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜