How to cancel Rx Based Web Request in Windows Phone 7

痞子三分冷 提交于 2020-01-03 05:23:15

问题


In my application i am using a Rx based web request for fetching the data from the server. Suppose if i want to cancel the request, what i need to do?


回答1:


Try using the extension method TakeUntil(someEvent), before Subscribe, where SomeEvent could be an Observable.FromEventPattern fired from button click event, for example.

Let us know,

regards,




回答2:


If you're asking how to cancel the subscription to an observable that is performing the web request then all you need to do is call .Dispose() on the disposable returned from the .Subscribe(Action action) method.



来源:https://stackoverflow.com/questions/9990882/how-to-cancel-rx-based-web-request-in-windows-phone-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!