dotnet / winforms

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

ObjectSelectorEditor,Selector,SelectorNode types are not available in the System.ComponentModel.Design namespace in .NetCore projects in WinForms #11654

Open Sekar47 opened 3 months ago

Sekar47 commented 3 months ago

Environment

Edition - Windows 11 Enterprise Version - 23H2 OS build - 22631.3737 Visual Studio version - 17.10.4

.NET version

.NetCore 6,7,8

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

No, it doesn't work on previous NetCore versions.

Issue description

In my NetCore project ,

  1. I'm trying to use the CustomSelectedBarEditor class. In that class i've inherit this ObjectSelectorEditor.
  2. In the Overridden FillTreeWithData function i've used the Selector as an argument and use the SelectorNode type of prop inside t my private FillTreeNodes function.

Issue: I can be able to achieve this in my Framework project. but due to the unavailability of these three types I can't be able to achieve in NetCore projects.

Steps to reproduce

Screenshot 2024-07-11 122704 Screenshot 2024-07-11 122730 Screenshot 2024-07-11 122755

Diagnostics

No response

elachlan commented 3 months ago

The code can be found here: https://referencesource.microsoft.com/#System.Design/System/ComponentModel/Design/ObjectSelectorEditor.cs,6837e6e1c6dadbb2

As a work around you could implement your own UITypeEditor?

@Olina-Zhang Is there some upgrade/conversion for this editor?

elachlan commented 3 months ago

@merriemcgaw is this something winforms is likely to implement?

elachlan commented 3 months ago

Related: #1115

elachlan commented 3 months ago

@Sekar47 it apparently exists and was implemented in .net core 3? You can find the source code at the link below: https://github.com/dotnet/winforms/blob/c7b604620172fe6fcdce92b7e1bb8edce450529c/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/ObjectSelectorEditor.cs

Sekar47 commented 3 months ago

Hi @elachlan , Now I'm working in .net core 8.0, In my project I can't see these types in that namespace.

Zheng-Li01 commented 3 months ago

@Sekar47, try this from .NET 6.0 to 9.0 that the ObjectSelectorEditor class can be find as below screenshot, could you please have a check if there missing anything? GHIssue11654

Sekar47 commented 3 months ago

In my application I'd installed the Microsoft.Winforms.Designer.SDK(1.6.0) as Nuget . that's why I can't be able to use these types with my classes. I need both (Nuget & these types) in my application. Is there any solution to move forward?

lonitra commented 3 months ago

@Sekar47 Could you give more details on your scenario? Are you using this at runtime or design time?

Sekar47 commented 3 months ago

Hi @lonitra , In our NetCore projects we've installed the Microsoft.Winforms.Designer.SDK for developing our custom control designers in winforms, but due to install this nuget we can't be able to utilize some types in the System.ComponentModel.Design namespace. without this SDK it is possible to use those types, but the difficulty comes only when i use the SDK. For an example, In the same screenshot which you provided, just install this SDK and then try to inherit this ObjectSelectEditor in your class.

Sekar47 commented 2 months ago

Hi @lonitra , Is there any update for this issue?

merriemcgaw commented 1 month ago

I'm sorry to say that we don't have an update for you at this point. We're looking into it for a future version and will update in the next week or so.