开发者

Cairngorm with FileReference?

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 tho开发者_如何学Cught is to have the delegate fire off progress events that are listened for in the View.

Any ideas would be greatly appreciated!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜