WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

Feature request for Listview

Open deltakosh opened this issue 10 years ago • 55 comments

Hello everyone, we plan to deprecate the PullToRefreshListView and introduce a kind of AdvancedListView with additional services like:

  • PullToRefresh
  • AlternatingDataTemplates
  • Always add HorizontalContentAlignment equal to Stretch on ListViewItem
  • Non tilt ListView style : so no animation when 'selecting' an item in the ListView, mostly used for glancing at data an no actual selecting is needed

Please use this thread to suggest other ideas

Edit: A great think would be to have both an unique AdvancedListView but also attached properties for every single additional features to allow developers to add on single feature to a random listview

deltakosh avatar Aug 18 '16 22:08 deltakosh

For reference sake, I added my alternating solution because it's fast and small. But it has limitations in the fact that it would only allow brushes. Using a datatemplate selector would be more ideal indeed, but that adds some performance overhead.

Depechie avatar Aug 18 '16 22:08 Depechie

Few other things I 'always' tend to add to my projects when working with ListView but are solved with Styles:

  • Non tilt ListView style : so no animation when 'selecting' an item in the ListView, mostly used for glancing at data an no actual selecting is needed
  • Always add HorizontalContentAlignment equal to Stretch on ListViewItem : why isn't this default in the SDK control ;)

Depechie avatar Aug 18 '16 22:08 Depechie

For #1 this is possible already I guess when you set selection to none

deltakosh avatar Aug 18 '16 22:08 deltakosh

YES about number 2, that is such a pain!

andrewleader avatar Aug 18 '16 22:08 andrewleader

Adding #2 to list in my initial post

deltakosh avatar Aug 18 '16 22:08 deltakosh

Adding to @Depechie's non tilt: I have a non-hover style as well for the data glancing (very annoying on desktop with mouse to have hover over elements if you can't select)

bartlannoeye avatar Aug 18 '16 22:08 bartlannoeye

Ok adding idea to main list

deltakosh avatar Aug 18 '16 22:08 deltakosh

@Depechie @bartlannoeye no need to use styles for that, just switch to ItemsControl instead of ListView. I've always used listviews only when items need to be selectable, otherwise I switch to ItemsControl by default

NicoVermeir avatar Aug 19 '16 09:08 NicoVermeir

@NicoVermeir well depends... if you want to other cool things ( like pull to refresh ) adding it to this merged ListView could be handy.

Depechie avatar Aug 19 '16 09:08 Depechie

@NicoVermeir ListView also gives you virtualisation out the box.

ScottIsAFool avatar Aug 19 '16 09:08 ScottIsAFool

@ScottIsAFool ah yes, true. only needed itemscontrol for small collections (around 10-15 items) so far. carry on!

NicoVermeir avatar Aug 19 '16 09:08 NicoVermeir

we plan to deprecate the PullToRefreshListView

Well, that was fast! But it would be a much better control. Maybe call it BetterListView or AdvanceListView :wink:

Here's a possible feature: Built-in item hierarchy. If an item is implementing IHierarchicalItem, with a property called Depth, add some padding to it. End result would be something like this:

haroldma-zz avatar Aug 19 '16 16:08 haroldma-zz

@haroldma I like that! I like that a lot. Is this something of yours?

ScottIsAFool avatar Aug 19 '16 16:08 ScottIsAFool

This is for 1.2 (and by deprecate I mean:keeping it but asking people to use the main one)

deltakosh avatar Aug 19 '16 16:08 deltakosh

@ScottIsAFool The screenshot is for a random app from google images. BUT here is a screenshot of it on one of my apps: :wink:

haroldma-zz avatar Aug 19 '16 16:08 haroldma-zz

@haroldma if you have the basis for it and would be willing to add it to this toolkit, that would be amazing :)

ScottIsAFool avatar Aug 19 '16 16:08 ScottIsAFool

Just try to not add yet another listview :) I would be ideal if this could be an attached property or something we can plug on a random listview

deltakosh avatar Aug 19 '16 16:08 deltakosh

@ScottIsAFool willing and able :wink:

@deltakosh like the idea of an attached property for any ListView but also have it baked into the AdvancedListView.

Will get a PR for this ASAP.

haroldma-zz avatar Aug 19 '16 16:08 haroldma-zz

@haroldma I await the PR :D

ScottIsAFool avatar Aug 19 '16 16:08 ScottIsAFool

@haroldma : Completely on the same page. Both are important!

deltakosh avatar Aug 19 '16 16:08 deltakosh