Skip to content

Commit 7833398

Browse files
jamesmcroftSergio0694
authored andcommitted
Updated wording for RaisePropertyChanged with broadcast method
1 parent bb838c6 commit 7833398

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/mvvm/MigratingFromMvvmLight.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,28 +229,32 @@ Also, string parameter is not required if the method is being called from the pr
229229

230230
#### RaisePropertyChanged<T> ( string, T, T, bool )
231231

232-
There is no direct replacement for the `RaisePropertyChanged<T>(string, T, T, bool)` method and any code using this should be altered or removed.
232+
There is no direct replacement for the `RaisePropertyChanged<T>(string, T, T, bool)` method.
233+
234+
The simplest alternative is to call `OnPropertyChanged` and subsequently call `Broadcast` to achieve this functionality.
233235

234236
```csharp
235237
// MvvmLight
236238
this.RaisePropertyChanged<MyObject>(nameof(this.MyProperty), this.oldValue, this.newValue, true);
237239

238240
// Toolkit.Mvvm
239-
// No direct replacement, remove
241+
this.OnPropertyChanged<MyObject>(nameof(this.MyProperty));
242+
this.Broadcast<MyObject>(this.oldValue, this.newValue, nameof(this.MyProperty));
240243
```
241244

242245
#### RaisePropertyChanged<T> ( Expression, T, T, bool )
243246

244247
There is no direct replacement for the `RaisePropertyChanged<T>(Expression, T, T, bool)` method.
245248

246-
It is recommended for improved performance that you replace this with the Toolkit's `RaisePropertyChanged<T>(string, T, T bool)` using the `nameof` keyword instead.
249+
The simplest alternative is to call `OnPropertyChanged` and subsequently call `Broadcast` to achieve this functionality.
247250

248251
```csharp
249252
// MvvmLight
250253
this.RaisePropertyChanged<MyObject>(() => this.MyProperty, this.oldValue, this.newValue, true);
251254

252255
// Toolkit.Mvvm
253-
this.RaisePropertyChanged<MyObject>(nameof(this.MyProperty), this.oldValue, this.newValue, true);
256+
this.OnPropertyChanged<MyObject>(nameof(this.MyProperty));
257+
this.Broadcast<MyObject>(this.oldValue, this.newValue, nameof(this.MyProperty));
254258
```
255259

256260
#### ICleanup.Cleanup ()

0 commit comments

Comments
 (0)