Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow internal types to be selected as object data source for binding #11408

Open
myth384 opened this issue May 21, 2024 · 3 comments
Open

Allow internal types to be selected as object data source for binding #11408

myth384 opened this issue May 21, 2024 · 3 comments
Assignees
Labels
area-Binding Impacting DataBinding area-VSDesigner Windows Forms out-of-proc designer related issues
Milestone

Comments

@myth384
Copy link

myth384 commented May 21, 2024

Environment

Microsoft Visual Studio Enterprise 2022 (64-bit) - Version 17.9.6

.NET version

.NET 8

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

Nope

Issue description

We are unable to select internal types as a DataSource for binding. Our company policy is to have all non-customer-facing public APIs set to internal and make them internally available within the company using the InternalsVisibleTo project element.

As a current workaround, we temporarily set the access modifier of the classes to public, and then revert them back to internal after selecting the type in question. However, this can become cumbersome with larger view models that have multiple layers of internal classes, where the public modifier has to cascade to every dependency.

Steps to reproduce

  1. Create a new .NET 8 WinForms project
  2. Create a internal class with a public property for data binding
  3. Add a control to the Form supporting data binding
  4. Attempt to set the DataSource (or DataContext) of the control to the internal class using the "Add and update object data sources" tool
  5. Observe an empty list

Diagnostics

No response

@myth384 myth384 added the untriaged The team needs to look at this issue in the next triage label May 21, 2024
@JeremyKuhne JeremyKuhne added area-VSDesigner Windows Forms out-of-proc designer related issues area-Binding Impacting DataBinding and removed untriaged The team needs to look at this issue in the next triage labels May 21, 2024
@JeremyKuhne JeremyKuhne added this to the VS release milestone May 21, 2024
@JeremyKuhne
Copy link
Member

@KlausLoeffelmann what is the plausibility of this?

@KlausLoeffelmann
Copy link
Member

@JeremyKuhne: It's likely an oversight and a breaking change from .NET Framework.
Need to be fixed in the Designer, though. -> VSNext.

@Olina-Zhang: If we haven't yet, can you create an Issue in the Designer (or move it to VSNext), and keep this open for tracking?

@Olina-Zhang
Copy link
Member

@KlausLoeffelmann we have a known Designer issue about Friend class is not shown when binding data source from project, can use it to track these similar issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Binding Impacting DataBinding area-VSDesigner Windows Forms out-of-proc designer related issues
Projects
None yet
Development

No branches or pull requests

4 participants