显示/隐藏 WP7 图钉上的内容
我有一个图钉 ContentTemplate:
<my:Pushpin.ContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding Text1}"/>
<TextBlock Text="{Binding Text2}"/>
</DataTemplate>
</my:Pushpin.ContentTemplate>
如何单击图钉来显示和隐藏它(地图上可能有很多图钉,我需要显示单击的图钉的内容)?
I have a puspin ContentTemplate:
<my:Pushpin.ContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding Text1}"/>
<TextBlock Text="{Binding Text2}"/>
</DataTemplate>
</my:Pushpin.ContentTemplate>
How could I show and hide it clickking on the pushpin (Could be a lot of pushpins on the map and I need to show the content of the clicked one)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已经将文本绑定到图钉上。您也可以将可见性绑定到它。我在这里假设每个图钉都绑定到一个单独的对象。
如果您不知道如何使用转换器,那么您可以搜索它们并找到各种应该有帮助的答案。为了方便起见,我将在此处添加一个
You are already binding text to your Pushpin. You can bind visibility to it as well. I am assuming here that each
Pushpin
is binding to a seperate object.If you don't know how to use converters, then you can search for them and find all kinds of answers that should be helpful. I'll include one here for convenience