Power BI

Content by Charles Sterling

Visual Studio not creating event handlers for WPF applications

Just saw the question:

I’ve noticed that in earlier Orcas builds and Visual Studio 2005 if you double click a WPF application’s button it does not create the normal button handler that a normal winform app would.

Unfortunately this functionality just hasn’t been implemented yet in these Orcas builds. You can still get Visual Studio to do this for your *Visual Basic projects -just takes a little extra work.  After you have added the control you want the event handler created for build the project. (CTL Shift B)

Open the code window; note F7 won’t work you need to use the Solution Explorer (see the green arrows below).

Select the object you want the event handler created for(see the red arrow below). If your object isn’t listed either you didn’t build the project or you didn’t name it when you hand wrote the XAML.  This is something i am always forgetting to do but doesn’t happen if you created object by dragging unto the form from the toolbox as Cider (the designer) automatically gives the XAML object a name.  

Select the event you want the handler for and Viola – instant handler!

(see image below)


*Even this doesn’t work in C# yet….