ListView: Provide the option to set custom empty template
An example with CollectionView:
<CollectionViewItemsSource="{Binding EmptyMonkeys}"EmptyView="No items to display" />
3 comments
Jason
Posted on:17 Mar 2023 13:04
Thanks, Didi,
I understand that there are workarounds available. For that matter, I could build all the functionality of your ListView control myself if I wanted to. The point of my comment is that if I'm going to spend $1000 or more on a UI framework, I expect features, not workarounds. Microsoft's built-in CollectionView has the EmptyView option already. It can handle the empty-list state with as little as one line of XAML. I would expect a commercial control to have at least feature parity with what you can get for free. As it stands, your suggested workaround costs around 20 lines of C# plus the required XAML. I'm unimpressed. If I find similar holes in other controls, I won't be buying.
ADMIN
Didi
Posted on:17 Mar 2023 05:37
Hi Jason,
The ListView does not have an empty template, this is why we have this feature request logged.
However there is an easy way to achieve an empty template:
- When your items source is empty, show the label. - When the collection is not empty, hide the label.