将可观察集合用于 bing 地图图钉

发布于 2024-10-10 18:20:09 字数 510 浏览 5 评论 0原文

我目前使用 C# 中的 MapLayer 在 WP7 Bing 地图上填充图钉。这没关系,但最近遇到了一些问题,包括地图控件中的错误导致了一些问题,所以我希望更改系统,在该系统中构建一个可观察的集合,该集合对图钉/位置等进行分类,然后绑定图钉位置使用 XAML 访问地图。与此类似: http ://beyondrelational.com/blogs/dinesh/archive/2010/06/26/bing-maps-binding-xml-data-source.aspx(不幸的是我无法开始工作。)

我的主要问题是,与其他集合相比,人们使用 ObservableCollection 是否有原因?

我将从提要中下载的 linq-to-xml 结果中对集合进行分类(以某种方式):-)

谢谢。

I currently populate pushpins on a WP7 Bing map using a MapLayer all in c#. This is ok, but have recently come across some issues including a bug in the map control causing some problems, so I am looking to change to the system where you build an observable collection which genreates the pushpins/locations etc, then bind the Pushpin locations to the map with XAML. Similar to this: http://beyondrelational.com/blogs/dinesh/archive/2010/06/26/bing-maps-binding-xml-data-source.aspx (which I cant quite get to work unfortunately.)

My main question is, Is there a reason people use ObservableCollection for this, as opposed to other collections?

I will be genreating the collection from linq-to-xml results downlaoded from a feed (somehow) :-)

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷路的信 2024-10-17 18:20:10

通常,ObservableCollection 用于绑定功能。当从 ObservableCollection 中添加/删除项目时,它们绑定到的 UI 元素将自动更新。

Generally ObservableCollection is employed for the binding functionality. When items are added/removed from an ObservableCollection, the UI element they are bound to will automatically update.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文