Repository navigation
Why custom ItemsControl does not show anything? #17337
|
I need to create a custom control based on ItemsControl. So, I have a data item of the following type: I have a blank CustomItemsControl: and here is a markup I'm expecting to work, that currently shows the empty blank screen at runtime: Funny enough the similar markup is perfectly working with traditional ItemsControl: I already tried to use DrawingContext to draw pictures and it works, but I need these pictures to by rotate-transformed from time to time while DrawingContext freezes them in initial state. So, can anybody explain how to instruct custom ItemsControl to display the data by means of data binding and ContentPresenter? |
Replies: 1 comment 3 replies
|
All You may also need to change |
All
TemplatedControls require aControlThemewith its type key by default. Without that, Avalonia cannot render a visual. If you want to use the sameControlThemeasItemsControl, then you want to useStyleKeyOverride. Otherwise, define and add your ownControlTheme.You may also need to change
<ItemsControl.ItemTemplate>(and the other children) to<cc:CustomItemsControl.ItemTemplate>.