Manuel
Manuel

Reputation: 275

MVVM Light Target for RaisepropertyChanged

I have the following code in a listener object, to evaluate if this message is for that listener:

 (this, (action) => { if (action.Target.GetType() == typeof(MainViewModel) && (action.PropertyName == "EditionMode" ))

The code of the sender:

set
         //  ...
               RaisePropertyChanged(() => MyProperty, oldValue, value, true);
         //  ...

but I can't find the right overload to set the Target.

Upvotes: 0

Views: 271

Answers (1)

bugged87
bugged87

Reputation: 3142

To call RaisePropertyChanged you need only pass the property name as a string argument:

RaisePropertyChanged("MyProperty");

Upvotes: 1

Related Questions