microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

How to nest ItemsControl?

Open Tartarusome opened this issue 1 year ago • 0 comments

Describe the bug

I hava two custom controls defined by class and ResourcesDictionary , both inherit from ItemsControl. When I insert the second one between the ControlTemplate and the ItemsPresenter of the first one, this control's items disappeared. before image after image

Steps to reproduce the bug

first one <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="FirstItemsControl"> <SecondItemsControl> <ItemsPresenter></ItemsPresenter> </SecondItemsControl> </ControlTemplate> </Setter.Value> </Setter>

second one <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="SecondItemsControl"> <SomePanel> <ItemsPresenter></ItemsPresenter> </SomePanel> </ControlTemplate> </Setter.Value> </Setter>

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.5.4: 1.5.240607001

Windows version

No response

Additional context

I tried these properties below, but they can only hide the internal structure from the visual tree. [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)]

### Tasks

Tartarusome avatar Jun 17 '24 08:06 Tartarusome