Bug 20166 - When adding an event in Designer, add the handler to the main class file as well as the .designer.cs file
Summary: When adding an event in Designer, add the handler to the main class file as w...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS Designer ()
Version: 3.0
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-05-29 15:25 UTC by Jon Goldberger [MSFT]
Modified: 2014-08-07 17:50 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

ScreenShot of iOS Designer Property page for a button (253.78 KB, image/png)
2014-05-29 17:42 UTC, Jon Goldberger [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jon Goldberger [MSFT] 2014-05-29 15:25:40 UTC
When adding an event to a control in iOS designer, the partial method declaration is added to the .designer.cs file but a shell method implementation is not added to the main .cs file for the class. As an enhancement, it would be nice if an empty method implementation was added as well.
Comment 2 Alex Corrado [MSFT] 2014-05-29 17:06:19 UTC
I think you should be able to double click the handler in the property panel to jump to the user code (adding the method stub if it wasn't there already). I'm not sure we want to just add it without jumping there, since this is the user (non-designer) cs file.
Comment 3 Jon Goldberger [MSFT] 2014-05-29 17:41:19 UTC
Alex, this doesn't seem to work on my end. I added the event and then double clicked the event handler in the iOS Designer property page for the control and nothing happened. I have attached an image to show you where exactly I double clicked. 

(I also noticed that clicking the X on the event handler does not remove the partial method declaration from the .designer.cs file, but that will be another bug report).
Comment 4 Jon Goldberger [MSFT] 2014-05-29 17:42:15 UTC
Created attachment 6917 [details]
ScreenShot of iOS Designer Property page for a button
Comment 5 Alan McGovern 2014-08-07 15:24:54 UTC
This was implemented months ago!
Comment 6 Jon Goldberger [MSFT] 2014-08-07 16:04:10 UTC
Yes, it does work for me now. The report was created 2.25 months ago. :-)
Comment 7 Alan McGovern 2014-08-07 17:50:00 UTC
Yup, i'm just triaging through VS issues and closing them as I find them :)