Ben Zuill-Smith
Ben Zuill-Smith

Reputation: 3822

MVVM Light RaisePropertyChanged Error

I followed examples of RaisePropertyChanged for the MVVM Light libraries in a WPF application. This seems like it should be valid. Event the code hints seem to think so. But when I build, Visual Studio gives me an error and then highlights RaisePropertyChanged with light blue squiggleys. Anyone seen this issue? Is there something obvious I'm missing?

Private _selectedServerInstance As String
Property SelectedServerInstance As String
  Get
      Return _selectedServerInstance
  End Get
  Set(value As String)
      _selectedServerInstance = value
      RaisePropertyChanged(Function() Me.SelectedServerInstance) //Error on build
  End Set
End Property

' Looks ok until I build. The Error for each line with RaisePropertyChanged using a lambda property selector is:
' error BC30518: Overload resolution failed because no accessible 'RaisePropertyChanged' can be called with these arguments:

Upvotes: 0

Views: 314

Answers (2)

josh
josh

Reputation: 21

System.Runtime and System.ObjectModel are not in the list of references to choose. Is this because they are 'facade' references, and rarely get used except in the crazy case of mvvm-light?

Upvotes: 0

bogza.anton
bogza.anton

Reputation: 606

for RaisePropertyChanged: References required to assemblies 'System.Linq.Expressions', 'System.Runtime', 'System.ObjectModel'.

Check References in your project.

Upvotes: 1

Related Questions