1

在 windows phone 7 中单击图钉时如何显示信息框?即单击图钉时需要在数据右侧显示一些数据和箭头按钮。请帮助我...

4

3 回答 3

1

当您单击图钉时,您会显示消息框。即在您的点击事件中放置消息框。参见下面的编码

                        pin[i] = new Pushpin();
                        pin[i].Location = new GeoCoordinate(Latitude, LongLatitude);

                        map1.Children.Add(pin[i]);
                        myCoorditeWatcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
                        myCoorditeWatcher.MovementThreshold = 20;

                        var gl = GestureService.GetGestureListener(pin[i]);
                        gl.Tap += new EventHandler<GestureEventArgs>(GestureListener_Stack_Tap);




 private void GestureListener_Stack_Tap(object sender, Microsoft.Phone.Controls.GestureEventArgs e)
        {
            for (int i = 0; i <= ClsGetDeviceMap.lstLongLatitude.Count - 1; i++)
            {
                if (sender.Equals(pin[i]))
                {
                    MessageBox.Show(ClsGetDeviceMap.lstLocationName.ElementAt<string>(i).Trim());
                                        MessageBox.Show(ClsGetDeviceMap.lstLatitude.ElementAt<string>(i).Trim());
                    MessageBox.Show(ClsGetDeviceMap.lstLongLatitude.ElementAt<string>(i).Trim());

                }
          }
        }
于 2012-07-26T05:54:11.227 回答
0

Bind sdk 站点上有很多示例:http: //www.bingmapsportal.com/isdk/ajaxv7

于 2013-12-09T11:19:30.733 回答
0

您可以自定义您的图钉

例如 :

<my:Map Name="map1">

                <my:Map.Resources>
                    <DataTemplate x:Key="pushpinTpl">
                        <my:Pushpin PositionOrigin="{Binding position}">
                            <my:Pushpin.ContentTemplate>
                                <DataTemplate>
                                    <ToggleButton x:Name="togButt" >
                                        <Grid>
                                            <TextBlock Text="click" 
                                                       Visibility="{Binding ElementName=togButt,Path=IsChecked,Converter={StaticResource BoolConverter},ConverterParameter=!}"/>
                                            <TextBlock Text="alternative content" 
                                                       Visibility="{Binding ElementName=togButt,Path=IsChecked,Converter={StaticResource BoolConverter}}"/>
                                        </Grid>
                                    </ToggleButton>
                                </DataTemplate>
                            </my:Pushpin.ContentTemplate>
                        </my:Pushpin>
                    </DataTemplate>
                </my:Map.Resources>

                <my:MapItemsControl ItemsSource="{Binding items}" 
                                    ItemTemplate="{StaticResource pushpinTpl}"
                                    />
            </my:Map>

希望这有帮助:)

于 2012-05-31T10:10:32.763 回答