By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,369 Members | 950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,369 IT Pros & Developers. It's quick & easy.

Inheritance propertychanged from Class don't work

P: 1
Hi, I am trying to call a Property with INotifyPropertyChanged from ClassB to ClassA, but this doesn't work!! What am I doing wrong?

Expand|Select|Wrap|Line Numbers
  1. Public Class ClassA
  2. Implements System.ComponentModel.INotifyPropertyChanged
  3.  
  4. Public Event PropertyChanged(ByVal sender As Object, ByVal e As
  5. System.ComponentModel.PropertyChangedEventArgs) Implements
  6. System.ComponentModel.INotifyPropertyChanged.PropertyChanged
  7.  
  8. Protected Overridable Sub OnPropertyChanged(ByVal e As
  9. System.ComponentModel.PropertyChangedEventArgs)
  10. RaiseEvent PropertyChanged(Me, e)
  11. End Sub
  12.  
  13. Private m_prop1 As String
  14.  
  15. Public Property Prop1() As String
  16. Get
  17. Return m_prop1 
  18. End Get
  19. Set(ByVal value As String)
  20. m_prop1 = value
  21. End Set
  22. End Property
  23.  
  24. End Class
  25.  
  26. Public Class ClassB
  27. Inherits ClassA
  28.  
  29. Private m_prop2 As String
  30.  
  31. Public Property Prop2() As String
  32. Get
  33. Return m_prop2 
  34. End Get
  35. Set(ByVal value As String)
  36. m_prop2 = value
  37. Dim e As New System.ComponentModel.PropertyChangedEventArgs("Prop1")
  38. OnPropertyChanged(e)
  39. End Set
  40. End Property
  41.  
  42. End Class
Apr 13 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.