将 ScatterViewItems 绑定到文件

发布于 2024-09-17 08:36:16 字数 325 浏览 2 评论 0原文

我正在使用 Surface Toolkit for Windows 7 beta 开发一个应用程序,并偶然发现了这个问题:

我有一个 ScatterView,它应该显示文件夹中的所有文件。因此,我使用 FileSystemWatcher 来识别添加、删除和重命名文件。为了呈现文件,我定义了 ItemTemplate。到目前为止,一切都很好。

我是 C# 和 WPF 的新手,但据我所知,最好的方法是将 ScatterView 的 ItemsSource 属性绑定到由我的 FSW 例程管理的 Collection。但我就是无法让它发挥作用!

我走对了吗? 有人有一些可以帮助我的例子吗?

I'm developing an application using the Surface Toolkit for Windows 7 beta and stumbled upon this problem:

I'm having a ScatterView which should show all files in a folder. Therefore I use a FileSystemWatcher that recognizes adding, deleting and renaming files. For presenting the files I define the ItemTemplate. So far so good.

I'm new to C# and WPF but as far as I know, the best way to do this is to bind the ItemsSource property of the ScatterView to a Collection which is managed by my FSW routine. But I just can't get it to work!

Am I on the right way?
Does anyone have some examples that could help me?

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

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

发布评论

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

评论(1

年华零落成诗 2024-09-24 08:36:16

我认为最好的方法是使用视图模型来表示文件并将视图模型绑定到 scatterview 中的项目

i think the best way is to use view models to represent the files and bind the view models to the items in the scatterview instead

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