Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

TWC9: New Team Members, Win8, C++, SQL 2012, Cloud Numerics

26 minutes, 43 seconds


Right click “Save as…”

This week on Channel 9, Dan is joined by new-member-of-the-team Rick Barraza to discuss the week's top developers news, including:

Picks of the Week!


Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • felix9felix9 the cat that walked by itself

    my recommendations:

    Localized versions of Silverlight 5 Tools !!!!

    PowerShell 3 and DLR

    http://codemash.org/ http://codemash.org/Sessions/Technology/.NET">.NET and http://codemash.org/Sessions/Technology/Windows%208">Windows 8 content, Jon Skeet is here

    EF 4.3 Beta 1 (and announcing EF 5.0)

    Code signing for the independent developer (a bit old though)

    Dorian Corompt's posts about functional programming


  • Adam SpeightAdam​Speight2008 The Bandito Coder

    On the subject of  INotifyPropertyChanged, the Anders Hejlsberg Way.

    The only issue I have with it is that it as to replicated across classes. 

    Now as I see it, if you slightly modify the code you can make it an extension method.

    Different interface, so you raise the event on the correct object. (As I don't no a way to externally trigger them.).

    Public Interface INotifyPropertyChanged_Extd
      Inherits INotifyPropertyChanged
      Sub RaisePropertyChangedEvent(ByVal source As Object, e As PropertyChangedEventArgs)
    End Interface
    Public Interface INotifyPropertyChanging_Extd
      Inherits INotifyPropertyChanged_Extd
      Sub RaisePropertyChangingEvent(ByVal source As Object, e As PropertyChangingEventArgs)
    End Interface

    Then you have the following extension method(s).


    Imports System.Runtime.CompilerServices
    Imports System.ComponentModel
    Imports System.Collections.Generic
    Public Module Exts
      <Extension> Public Sub SetProperty(Of T, U As INotifyPropertyChanging_Extd)(ByVal obj As U,
                                                                              [property] As String,
                                                                              toValue As T,
                                                                              ByRef usingField As T, Optional ignored As Object = Nothing)
        If obj Is Nothing Then Exit Sub
        If Not EqualityComparer(Of T).Default.Equals(usingField, toValue) Then
          Dim old = usingField
          obj.RaisePropertyChangingEvent(obj, New PropertyChangingEventArgs([property]))
          usingField = toValue
          obj.RaisePropertyChangedEvent(obj, New PropertyChangedEventArgs([property]))
        End If
      End Sub
      <Extension> Public Sub SetProperty(Of T, U As INotifyPropertyChanged_Extd)(ByVal obj As U,
                                                                              [property] As String,
                                                                              toValue As T,
                                                                              ByRef usingField As T)
        If obj Is Nothing Then Exit Sub
        If Not EqualityComparer(Of T).Default.Equals(usingField, toValue) Then
          usingField = toValue
          obj.RaisePropertyChangedEvent(obj, New PropertyChangedEventArgs([property]))
        End If
      End Sub
    End Module


    Example Class using this extension method.


    Public Class Example
      Implements INotifyPropertyChanged_Extd
      Private _Value As Integer
      Property Value As Integer
          Return _Value
        End Get
        Set(value As Integer)
          Me.SetProperty("Value", value, _Value)
        End Set
      End Property
      Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
      Public Sub RaisePropertyChangedEvent(source As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged_Extd.RaisePropertyChangedEvent
        RaiseEvent PropertyChanged(source, e)
      End Sub
    End Class

    And the _PropertyChanged event being handled.

    Class MainWindow 
      Private WithEvents MyExample As New Example
      Private Sub MyExample_PropertyChanged(sender As Object, e As ComponentModel.PropertyChangedEventArgs) Handles MyExample.PropertyChanged
      End Sub
    End Class

  • felix9felix9 the cat that walked by itself

    +1 Zero Day: A Non-Fiction View

  • INotifyPropertyChanged, the Anders Hejlsberg Way:

    Good feedback and an interesting discussion.

    In terms of visual density, this was partly due to the fact that Anders codes using K&R style bracing instead of Allman, as well as the extra code he uses to properly avoid the race condition that exists in the MSDN example. I updated the blog post to use Allman style for both.

    The other thing I did want to point out was that there is at least one other advantage besides just reductions in raw lines of boiler plate code in property setter, which is that it sets up a Pit of Success for properly implementing INotifyPropertyChanged in subclasses.

    I work on a very large WPF/C# enterprise project at the moment and there are literally *thousands* of incorrectly implemented properties in the application that need to be fixed to properly check for inequality before setting the field and raising the event.

    I appreciate the discussion even if you don't agree with the post. (:

  • CharlesCharles Welcome Change

    Welcome to the C9 team, Rick and Brian!


  • I started watching this podcast on my bus ride into work today.  Rick, you used a term I've not heard before, called "New Developers".  I think you said it is a term that was introduced at the Build conference.  I wasn't able to make the Build conference, so would you please define what that term means.

  • Rick Barrazarbarraza Form Follows Fiction

    Hi Rod, Sorry for the delay. I was heads down in code and just got out. I said "New Developer" but the phrase that was introduced was actually "modern developer". I think that one is more accurate, but still very amorphous right now. At the core, would be the "traditional" seasoned developer, tackling the big, hairy enterprise level projects and master weilder of all things COM or .NET. That's really the foundation. But we're entering a time where building on top of that are a vast army of web developers, Javascript masters, interaction developers, designers who code, scripters, etc. In Windows 8, we're seeing an introductory level playing field between C++, Javascript and C#. Canvas and HTML5 are blowing up, and DirectX 11.1 becoming more accessible through the OS is going to also create a lot of great opportunities for everyone up and down the stack. From Designers who code all the way down to enterprise dev super stars. From Phone to Hardware to Cloud, from browser based scripts all the way down to running native on the metal and GPU. I think of "modern developer" as being representitive of this entire spectrum, and that's how I was using it. A sign of the massive opportunities coming into the Microsoft ecosystem. Hope that helps. - rk

  • @rbarraza: Rick, it's my turn to apologize for not responding sooner.  WOW, almost a month after you replied to me.  I'm sorry!

    Thank you for your description as to what you mean by a "new developer".  It's interesting, then, as it now seems like Microsoft is going to make it possible for the hobbiest developer to get back into the game, so to speak.  I know that you meant more than that, but it seems as though the new developer would be someone who isn't necessarily a heavy duty enterprise developer (although they're included), but could also be the person who writes a few scripts on the side, occasionally dabbles in HTML and JavaScript, that Windows 8 will open it up for people like that again.  Something that was lost with each new version of VS.

  • Welcome Dan. And a nice video though, several interesting things.

Remove this comment

Remove this thread


Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.