This is just a simple little thing cause i'm bored at work and i figure it could be helpful to ppl later, as figuring this out was very helpful to me long ago, and now i almost never make a class without it.

code Code:
  1. 'Needed for Implementing the Inotify change event
  2. Imports System.ComponentModel
  3.  
  4. Public Class Class1
  5.     Implements INotifyPropertyChanged
  6.  
  7. #Region "Inotify"
  8.     ''' <summary>
  9.     ''' Duh? the sub Value for our String Property
  10.     ''' </summary>
  11.     ''' <remarks></remarks>
  12.     Private _strValue As String
  13.  
  14.     ''' <summary>
  15.     ''' The Stringed Property to watch
  16.     ''' </summary>
  17.     ''' <value></value>
  18.     ''' <returns></returns>
  19.     ''' <remarks></remarks>
  20.     Property strValue As String
  21.         Get
  22.             Return _strValue
  23.         End Get
  24.         Set(ByVal value As String)
  25.             'No need to change it if it's still the same
  26.             If _strValue <> value Then
  27.                 _strValue = value
  28.                 ' Raise the Event Flag!
  29.                 OnPropertyChanged(value)
  30.             End If
  31.         End Set
  32.     End Property
  33.  
  34.     ''' <summary>
  35.     ''' Establish the event
  36.     ''' </summary>
  37.     ''' <remarks></remarks>
  38.     Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
  39.  
  40.  
  41.     ''' <summary>
  42.     ''' Sub to run on the event
  43.     ''' </summary>
  44.     ''' <param name="name"></param>
  45.     ''' <remarks></remarks>
  46.     Sub OnPropertyChanged(ByVal name As String)
  47.         Dim handler As PropertyChangedEventHandler = PropertyChangedEvent
  48.  
  49.         If handler IsNot Nothing Then
  50.             handler(Me, New PropertyChangedEventArgs(name))
  51.         End If
  52.  
  53.     End Sub
  54.  
  55.     ' Dim your class with events and walla
  56. #End Region
  57.  
  58. End Class

' Dim your class with events and walla