Kiang Teng
Kiang Teng

Reputation: 1705

'Messenger class does not exist in this context' - MVVM Light

I'm trying to use the MVVM Light Messenger class and have created a ViewModel class using the template. When trying to use the method Messenger.Default.Register however, the Messenger class does not seem to be defined. Am I missing a reference or something?

Upvotes: 0

Views: 519

Answers (2)

usefulBee
usefulBee

Reputation: 9702

A similar error message could also be triggered if attempting to register outside a method or a constructor.

enter image description here

Upvotes: 0

LBugnion
LBugnion

Reputation: 6662

The Messenger class is included in GalaSoft.MvvmLight.dll. Make sure in your References folder that the reference has been added, and is not broken.

Cheers, Laurent

Upvotes: 2

Related Questions