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

Data Bindings should use nameof instead of raw string literals. #11694

Open
egvijayanand opened this issue Jul 17, 2024 · 5 comments
Open

Data Bindings should use nameof instead of raw string literals. #11694

egvijayanand opened this issue Jul 17, 2024 · 5 comments
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation area-Binding Impacting DataBinding area-VSDesigner Windows Forms out-of-proc designer related issues tracking
Milestone

Comments

@egvijayanand
Copy link

egvijayanand commented Jul 17, 2024

Background and motivation

Data Bindings should use nameof instead of raw string literals.

This would help in tracking the usage references and any renames later.

API Proposal

// Before
joinDatePicker.DataBindings.Add(new Binding("Value", employeeViewModelBindingSource, "JoinDate", true));
// After
joinDatePicker.DataBindings.Add(new Binding(nameof(DateTimePicker.Value), employeeViewModelBindingSource, nameof(EmployeeViewModel.JoinDate), true));

API Usage

Designer generated code.

Alternative Designs

No response

Risks

No response

Will this feature affect UI controls?

I don't think so.

@egvijayanand egvijayanand added api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation untriaged The team needs to look at this issue in the next triage labels Jul 17, 2024
@elachlan elachlan added area-VSDesigner Windows Forms out-of-proc designer related issues area-Binding Impacting DataBinding labels Jul 17, 2024
@elachlan
Copy link
Contributor

@Olina-Zhang can your team link this to the designer issue? I think this has been raised previously.

@Olina-Zhang
Copy link
Member

It seems we haven't known issue in designer repo, I will create one for it.

@elachlan
Copy link
Contributor

I think its covered in #10153

Some what related: #8350

@elachlan
Copy link
Contributor

CC: @KlausLoeffelmann for visibility.

@Olina-Zhang
Copy link
Member

I filed this specific case in winforms-deisgner repo: https://github.com/microsoft/winforms-designer/issues/6024

@lonitra lonitra added tracking and removed untriaged The team needs to look at this issue in the next triage labels Sep 5, 2024
@lonitra lonitra added this to the VS release milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation area-Binding Impacting DataBinding area-VSDesigner Windows Forms out-of-proc designer related issues tracking
Projects
None yet
Development

No branches or pull requests

4 participants