CollectionView with RemainingItemsThresholdReachedCommand does not like RelayCommand bound methods
Describe the bug
When making an async method and annotate it with the RelayCommand attribute, assigning it to the RemainingItemsThresholdReachedCommand will generate some weirdness, the method will only rarely execute correctly. But when I create an AsyncRelayCommand myself and remove the RelayCommand attribute, everything works as expected
Regression
No response
Steps to reproduce
-
Create a CollectionView with the RemainingItemsThresholdReachedCommand event and some items, so you can get to the threshold Example:
<CollectionView RemainingItemsThreshold="1" RemainingItemsThresholdReachedCommand="{Binding MyAsyncFunctionCommand}"> -
Create the function Example:
[RelayCommand]
private async Task MyAsyncFunction()
{
await Task.Delay(2000);
Debug.WriteLine("Hello, world!");
}
- Observe that the function does not fire correctly
Expected behavior
Whenever the collectionview reaches its end, the event gets fired normally
Screenshots
No response
IDE and version
Rider
IDE version
JetBrains Rider 2024.3
Nuget packages
- [x] CommunityToolkit.Common
- [ ] CommunityToolkit.Diagnostics
- [ ] CommunityToolkit.HighPerformance
- [ ] CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)
8.4.0
Additional context
No response
Help us help you
No, just wanted to report this