chadr chadr

Niner since 2004

I currently work as a Lead Program Manager on the Visual Studio Core team, responsible for what could best be termed "Code Focused Development," designing and driving the features that are most closely related to a developer's most important asset: code. These features are the core editor and Intellisense, code navigation tools like the Object Browser and ClassView, the Project and Solution system, and the new MSBuild build system.


  • Visual Studio Orcas Express: Building "Hello World" using Windows Presentation Foundation

    So, the Beta 1 technology that is implemented for WPF to support event hookup is exactly the same for both VB and C#.  That is, at Beta 1, there are no more or less lines of code in the designer for either language's support of events in WPF.  And that LOC count is, effectively, zero in Beta 1 Smiley *

    The odd and confusing reality is, without designer support for event hookup in Beta 1, you're seeing the fallback feature of code-editor-only support -- which is the same for WPF as it is for Windows Forms.  And, as with Windows Forms, there are some differences between C# and VB for event code gen and hookup.

    Once WPF Designer & XAML Language Service event support comes online (as it is today in our internal builds and you'll see in Beta 2), intellisense will give completion on events in the XAML editor, and double-clicking on a control will generate the handler and take you to code.

    No harm in asking about a feature you care about, just try not to use Beta 1 to jump to conclusions about the final product or how we prioritize language support.  We're still working Smiley

    * Note: it's not really zero, but there are multiple levels and layers of goo that have to be in place to make event hookup work, each of which is necessary but not sufficient.  Not all goo was there, so effectively there's nothing there cuz you can't see any features.

  • Visual Studio Orcas Express: Building "Hello World" using Windows Presentation Foundation

    Great questions you both raise!  The fact is our Beta 1 release supports both VB and C# in code behind.  We don't yet have design-surface support for either language.  We don't yet have intellisense support for either language.

    The reason I chose VB here is because VB's language allows for the "Handles" declarator, and the language service generates handlers from those object/event dropdowns in the editor.  It just made the example more streamlined -- didn't mean to imply that C# didn't work, it just works differently.

    I could have shown C#'s equivalent scenario by going into the Window1 ctor and typing " +=..." and then C# would have gen'd a handler stub for me and completed the delegate add.  Download the Beta and give that a try Smiley

    Maybe what I really hear you folks saying is our next video should be "All the different ways you can generate and hookup event handlers in Beta 1, with VB and C#".  I'm happy to oblige on that one...