Skip to content

Why custom ItemsControl does not show anything? #17337

Answered by stevemonaco
alex-valchuk asked this question in Q&A
Discussion options

You must be logged in to vote

All TemplatedControls require a ControlTheme with its type key by default. Without that, Avalonia cannot render a visual. If you want to use the same ControlTheme as ItemsControl, then you want to use StyleKeyOverride. Otherwise, define and add your own ControlTheme.

You may also need to change <ItemsControl.ItemTemplate> (and the other children) to <cc:CustomItemsControl.ItemTemplate>.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@alex-valchuk
Comment options

@alex-valchuk
Comment options

@stevemonaco
Comment options

Answer selected by alex-valchuk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants