Open
Description
Current behavior
When building the project on Uno targets it fails with:
error CS1527: Elements defined in a namespace cannot be explicitly declared as private, protected, protected internal, or private protected
A namespace cannot directly contain members such as fields, methods or statements
'IMainPage_Bindings' is inaccessible due to its protection level
The type '<invalid-global-code>' already contains a definition for '_Item'
The type '<invalid-global-code>' already contains a definition for 'Item'
IMainPage_Bindings' is inaccessible due to its protection level
IMainPage_Bindings' in explicit interface declaration is not an interface
The type 'MainPage' already contains a definition for '_Item'
...
This works well with WinUI.
Expected behavior
No response
How to reproduce it (as minimally and precisely as possible)
e.g.
<ListView ItemTemplateSelector="{StaticResource ItemTemplateSelector}">
<ListView.Items>
<local:Item IsSpecial="False" />
<local:Item IsSpecial="True" />
<local:Item IsSpecial="False" />
<local:Item IsSpecial="True" />
</ListView.Items>
</ListView>
more detailed repro:
SourceGenitemsIssue.zip
Workaround
Rename Item class to anything else.
<ListView ItemTemplateSelector="{StaticResource ItemTemplateSelector}">
<ListView.Items>
<local:MyEntity IsSpecial="False" />
<local:MyEntity IsSpecial="True" />
<local:MyEntity IsSpecial="False" />
<local:MyEntity IsSpecial="True" />
</ListView.Items>
</ListView>
No response
Works on UWP/WinUI
Yes
Environment
No response
NuGet package version(s)
No response
Affected platforms
WebAssembly, Android, iOS, Mac Catalyst, Skia (WPF), Skia (Linux X11), Skia (macOS), Skia (Linux Framebuffer), Skia (GTK)