Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CollectionView issues #2

Open
4 of 6 tasks
Dreamescaper opened this issue May 11, 2022 · 0 comments
Open
4 of 6 tasks

CollectionView issues #2

Dreamescaper opened this issue May 11, 2022 · 0 comments

Comments

@Dreamescaper
Copy link
Owner

Dreamescaper commented May 11, 2022

  • Grouping is not supported
    Because CollectionView is a generic component, it is not possible to set ItemsSource to some Groupping type. I suppose I could simply define a separate property (e.g. GrouppedItemsSource) for this purpose.

  • ItemsSource should be an ObservableCollection if you need to handle items addition/removal.
    We need that since items are managed outside of Blazor. That's not really a Blazor way though.
    Maybe it's possible to use some kind of wrapper, and calculate diffs between updates, not sure.

  • SelectedItems property has object type.
    I cannot simply cast IList<object> to IList<T>. And I cannot simply invoke .Cast<T>().ToList(), because that leads to an infinite loop if property is binded.

  • SelectedItem property has object type.
    Slightly different issue here. T can be both class and struct. OTOH, SelectedItem is nullable. I don't know how to declare a nullable type which would work in generic context without constraints.

  • Templated Header/Footer/Empty view are not supported.
    Decided to implement separately.

  • Because added items are rendered asynchronously, sequence of actions is not always obvious.
    In my case, I'm adding items to the source, and removing the activity indicator from footer when items are loaded (infinite scroll).
    But from XF perspective it happens the opposite way - activity indicator is removed, and then items are added. This leads to slightly wrong scroll position.
    I was able to workaround that by adding await Task.Yield() to the end of my method.
    Not sure how to resolve it globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant