Windowscommunitytoolkit: How to cancel Incrementalloadingcollection request

Created on 8 Dec 2016  路  6Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

This is more a question than an issue: I'm using IncrementalLoadingCollection in my project and I want to cancel a request but don't know how to do it... There is a cancellationToken in the class but its private...

helpers question

All 6 comments

Ping @marcominerva

The CancellationToken is passed as an argument in the GetPagedItemsAsync method (that is exposed by the IIncrementalSource interface). Have you tried using it?

It is cancellable by passing it to the GetPagedItemsAsync method as @marcominerva mentioned.

I know, but when I Bind the collection to a gridview the control itself makes the call to the method and i can't cancel it. I'm stuck with that...

If you pass an explicit instance of IIncrementalSource (say MySource) to IncremetalLoadingCollection, than you have complete control, for example you can add a Cancel property to MySource and check it in the GetPagedItemsAsync method to determine whether to set the CancellationToken.

Thats it! Thank you very much for the help :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hermitdave picture hermitdave  路  58Comments

ThomasPe picture ThomasPe  路  28Comments

deltakosh picture deltakosh  路  48Comments

0pd picture 0pd  路  28Comments

hermitdave picture hermitdave  路  78Comments