带有 FileReference 的凯恩戈姆?

发布于 2024-08-17 20:36:55 字数 171 浏览 3 评论 0原文

我正在寻找有关如何将 FileReference 方法(例如 Upload)合并到 Cairngorm 架构中的任何想法。

具体来说,我想触发一个包含文件的事件,这很好。但是,如何才能侦听进度事件等事件呢?

我想到的一件事是让委托触发在视图中侦听的进度事件。

任何想法将不胜感激!

I'm looking for any ideas on how to incorporate FileReference method like Upload into a Cairngorm architecture.

Specifically, I would think to fire an event with the File in it, and that's fine. But how would one then be able to listen for e.g. Progress Events?

One thing I thought is to have the delegate fire off progress events that are listened for in the View.

Any ideas would be greatly appreciated!

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

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

发布评论

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

评论(1

若水微香 2024-08-24 20:36:56

您可以在视图中创建 FileReference 类的实例,将其分配给视图中的属性并在其中侦听 ProgressEvent。然后让您的命令或委托在您分派事件后处理启动上传。

如果您不喜欢视图实例化 FileReference 的想法,您可以编写一个将 FileReference 作为属性的帮助器类,在视图中分配帮助器对象,将帮助器对象分配给您的事件,然后重复相同的操作步骤如上所述,只不过现在命令或委托还将负责实例化辅助对象上的 FileReference。

You could create an instance of the FileReference class in your view, assign it to a property in the view and listen for ProgressEvent there. Then let your Command or Delegate handle initiating the upload after you've dispatched the Event.

If you don't like the idea of a View instantiating a FileReference, you could write a helper class that has the FileReference as a property, assign the helper object in your View, assign the helper object to your Event, and then repeat the same steps as above, except now the Command or Delegate would also take responsibility for instantiating the FileReference on the helper object.

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