开发者

Is it possible to subscribe somehow to "file write" event on WP 7.5?

开发者 https://www.devze.com 2023-04-04 18:13 出处:网络
I want to get a chunk of data that has been written to a file by some thread in another thread and process it.

I want to get a chunk of data that has been written to a file by some thread in another thread and process it.

UPD: Sorry guys, forgot to mention I need it on WP 7.5. There is no FileSystemWatcher the开发者_如何学编程re AFAIK.


The FileSystemWatcher class has a Changed event.


You should check out the FileSystemWatcher class. It exposes the different events you can subscribe to (Created, Changed, Deleted, etc.)


Check the FileSystemWachter as described here MSDN


As far as I am aware, each application only has access to it's own isolated storage on the device. Thus no application can read another applications data on the device.

Designing Applications for Windows Phone 7


There is no event built in but that doesn't mean you couldn't create your own which you fire when you've finished writing to IS. As you must do the writing to file yourself then this shouldn't be an issue.

Alternatively you could use a messaging system (ala MvvmLight) to signal that the writign is complete.

If you want to notify from a background agent then the only option would be to create a raw notification request from the agent to the app. (I haven't tried this but apparently it works.)

0

精彩评论

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