Refactor ItemContainerGenerator API
See original GitHub issueThe ItemContainerGenerator
API needs a rework; in particular its materialized events are rather confused and don’t really fire when they should.
We need to decide a few things:
- Should we follow the WPF API for
ItemContainerGenerator
? Personally I’ve always found this API confusing as it splits container generation between theItemsControl
and the generator, with the generator just being used to signal that it’s creating “batches” and the actual containers being created by theItemsControl
itself with a bunch of overridable methods there - The UWP API seems to be slightly simpler but I’m unfamiliar with it
- The WinUI
ElementFactory
API is much nicer though it still has things I don’t like much - mainly the fact that one needs to create a newElementFactoryGetArgs
object for each container generated. In particular though theItemsRepeater
events for prepared/cleared/index changed are much nicer than having to override methods in WPF/UWP
We probably want a hybrid of these APIs, which leave the main part of the API unchanged from 0.10.x for the simple use-case of defining a new container type.
Issue Analytics
- State:
- Created 10 months ago
- Comments:14 (12 by maintainers)
Top Results From Across the Web
ItemContainerGenerator Class (System.Windows.Controls)
Generates the user interface (UI) on behalf of its host, such as an ItemsControl.
Read more >Refactoring the following methods to make it easier to read
ItemContainerGenerator.ContainerFromItem(plotList) as ListViewItem; if (container == null) return; container.IsSelected = true; container.
Read more >WPF: Raise programmatically a SelectionChangedEvent ...
I solved the issue by changing the index to -1 then changing it back to the previous value, but I would rather just...
Read more >WPF DataGrid - Changes
API for scrolling item into view by item's index ... Refactor RowEditEnded event to use data item instead of UI object. Group descriptions...
Read more >OpenSilver 1.1 released
Moving code from Silverlight to OpenSilver is made easier with support for over 100 additional Silverlight APIs. Developers can now reuse ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Tulesha opened a PR to add support for this: https://github.com/AvaloniaUI/Avalonia/pull/11068
Yep, this will be addressed before 11.0!