-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Partial methods as controls events #14650
Copy link
Copy link
Open
Labels
api-suggestion(1) Early API idea and discussion, it is NOT ready for implementation(1) Early API idea and discussion, it is NOT ready for implementationuntriagedThe team needs to look at this issue in the next triageThe team needs to look at this issue in the next triagewaiting-author-feedbackThe team requires more information from the authorThe team requires more information from the author
Metadata
Metadata
Assignees
Labels
api-suggestion(1) Early API idea and discussion, it is NOT ready for implementation(1) Early API idea and discussion, it is NOT ready for implementationuntriagedThe team needs to look at this issue in the next triageThe team needs to look at this issue in the next triagewaiting-author-feedbackThe team requires more information from the authorThe team requires more information from the author
Type
Fields
Give feedbackNo fields configured for issues without a type.
Background and motivation
Currently, when you have a control, say a button, in the visual form designer, and you double-click it, it generates a normal method in the the MyForm.cs file, such as:
And in MyForm.designer.cs it just adds
Now, if you will remove this method, it will cause a designer error, and you'll have to go to the designer code and manually delete this line. For beginners it's especially problematic...
I think that a better approach would be to generate partial method, and add its signature in the designer:
This way, if you will delete the method implementation, it won't be an error.
API Proposal
API Usage
Form1.designer.cs:
Alternative Designs
No response
Risks
No response
Will this feature affect UI controls?
The VS designer will need to generate event methods as partial methods.