Skip to content

Commit 191acbf

Browse files
jamesmcroftSergio0694
authored andcommitted
Reorganised methods for ObservableRecipient
1 parent aa06345 commit 191acbf

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

docs/mvvm/MigratingFromMvvmLight.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -163,26 +163,6 @@ Below are a list of migrations that will need to be performed if being used in y
163163

164164
### ViewModelBase Methods
165165

166-
#### ICleanup.Cleanup ()
167-
168-
There is no direct replacement for the `ICleanup` interface.
169-
170-
However, the `ObservableRecipient` provides an `OnDeactivated` method which should be used to provide the same functionality as `Cleanup`.
171-
172-
`OnDeactivated` in the MVVM Toolkit will also unregister all of the registered messenger events when called.
173-
174-
```csharp
175-
// MvvmLight
176-
this.Cleanup();
177-
178-
// Toolkit.Mvvm
179-
this.OnDeactivated();
180-
```
181-
182-
Note, the `OnActivated` and `OnDeactivated` methods can be called from your existing solution as with `Cleanup`.
183-
184-
However, the `ObservableRecipient` exposes an `IsActive` property that also controls the call to these methods when it is set.
185-
186166
#### Set<T> ( string, ref T, T, bool )
187167

188168
`Set<T>(string, ref T, T, bool)` does not have a like-for-like method signature replacement.
@@ -273,6 +253,26 @@ this.RaisePropertyChanged<MyObject>(() => this.MyProperty, this.oldValue, this.n
273253
this.RaisePropertyChanged<MyObject>(nameof(this.MyProperty), this.oldValue, this.newValue, true);
274254
```
275255

256+
#### ICleanup.Cleanup ()
257+
258+
There is no direct replacement for the `ICleanup` interface.
259+
260+
However, the `ObservableRecipient` provides an `OnDeactivated` method which should be used to provide the same functionality as `Cleanup`.
261+
262+
`OnDeactivated` in the MVVM Toolkit will also unregister all of the registered messenger events when called.
263+
264+
```csharp
265+
// MvvmLight
266+
this.Cleanup();
267+
268+
// Toolkit.Mvvm
269+
this.OnDeactivated();
270+
```
271+
272+
Note, the `OnActivated` and `OnDeactivated` methods can be called from your existing solution as with `Cleanup`.
273+
274+
However, the `ObservableRecipient` exposes an `IsActive` property that also controls the call to these methods when it is set.
275+
276276
### ViewModelBase Properties
277277

278278
#### MessengerInstance

0 commit comments

Comments
 (0)