question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactor ItemContainerGenerator API

See original GitHub issue

The 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 the ItemsControl and the generator, with the generator just being used to signal that it’s creating “batches” and the actual containers being created by the ItemsControl 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 new ElementFactoryGetArgs object for each container generated. In particular though the ItemsRepeater 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:closed
  • Created 10 months ago
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
grokyscommented, Apr 19, 2023

@Tulesha opened a PR to add support for this: https://github.com/AvaloniaUI/Avalonia/pull/11068

1reaction
grokyscommented, Nov 22, 2022

Should Items vs ItemsSource be considered again as well: https://github.com/AvaloniaUI/Avalonia/issues/7553

Yep, this will be addressed before 11.0!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found