dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.29k stars 957 forks source link

UserControls with type parameters cannot be designed in .NET Core #11124

Open janseris opened 3 months ago

janseris commented 3 months ago

Environment

Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.9.2

.NET version

.NET 8

Did this work in a previous version of Visual Studio and/or previous .NET release?

Yes it worked in .NET Framework

Issue description

UserControls with type parameters cannot be designed in .NET Core

Steps to reproduce

https://github.com/janseris/WinFormsGenericUserControlDesignerTest And open designer for all UserControls in the NetCore projct

https://github.com/dotnet/winforms/assets/64279914/aa6d36a1-41dc-4707-bdbf-b1659608cc66

elachlan commented 3 months ago

related to #3328 and #10368

Its on the teams backlog, but is unlikely to be done.

CC: @merriemcgaw

janseris commented 3 months ago

@elachlan thanks for info. btw this is not a suggestion or feature request but a bug because it works in Framework It is stopping us from adopting Core

merriemcgaw commented 3 months ago

@janseris Thanks for reaching out about the issue. Knowing it is blocking your adoption of Core is a key piece of feedback we need in the prioritization process! @KlausLoeffelmann let's discuss this issue, and whether we can get it on a future release.

Tanya-Solyanik commented 3 months ago

Yeah, generic controls that derive from a non-generic type, should be designable.

    public partial class FilesListViewBase<TFileModel> : UserControl
        where TFileModel : FileModelBase
    {
KlausLoeffelmann commented 3 months ago

I (have to) (absolutely) agree. @Olina-Zhang, can you create a corresponding designer issue, and assign it to me? Targeting 17.11 > Preview 2.

Olina-Zhang commented 3 months ago

Filed a designer issue: https://github.com/microsoft/winforms-designer/issues/5906.