Skip to content

Commit 5c54b07

Browse files
jamesmcroftSergio0694
authored andcommitted
Updated docs for Messenger reset methods.
1 parent 5a48167 commit 5c54b07

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/mvvm/MigratingFromMvvmLight.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -739,16 +739,16 @@ Messenger.Default.RequestCleanup();
739739

740740
#### ResetAll ()
741741

742-
There is no direct replacement for the `ResetAll` method in the MVVM Toolkit. In the context of MvvmLight, this method is used to reset the default `IMessenger` instance by calling the static `Reset` method.
742+
The functionality of `ResetAll()` can be achieved with the MVVM Toolkit's `Reset()` method.
743743

744-
Any calls to the `ResetAll()` method can be removed.
744+
Unlike MvvmLight's implementation which nulls out the instance, the MVVM Toolkit clears the registered maps.
745745

746746
```csharp
747747
// MvvmLight
748748
Messenger.Default.ResetAll();
749749

750750
// Toolkit.Mvvm
751-
// No direct replacement, remove
751+
Messenger.Default.Reset();
752752
```
753753

754754
### Messenger Static Methods
@@ -757,28 +757,28 @@ Messenger.Default.ResetAll();
757757

758758
There is no direct replacement for the `OverrideDefault(IMessenger)` method in the MVVM Toolkit.
759759

760-
Any calls to the `Messenger.OverrideDefault(IMessenger)` method can be removed.
760+
To use a custom implementation of the `IMessenger`, either registered the custom implementation in the service registrations for dependency injection or manually contruct a static instance and pass this where required.
761761

762762
```csharp
763763
// MvvmLight
764764
Messenger.OverrideDefault(new Messenger());
765765

766766
// Toolkit.Mvvm
767-
// No direct replacement, remove
767+
// No direct replacement
768768
```
769769

770770
#### Reset ()
771771

772-
There is no direct replacement for the `Reset` method in the MVVM Toolkit. In the context of MvvmLight, this static method is used to reset the default `IMessenger` instance.
772+
There is no direct replacement for the static `Reset` method in the MVVM Toolkit.
773773

774-
Any calls to the `Messenger.Reset()` method can be removed.
774+
The same functionality can be achieved by calling the `Reset` method of the static `Default` instance of the `Messenger` class.
775775

776776
```csharp
777777
// MvvmLight
778778
Messenger.Reset();
779779

780780
// Toolkit.Mvvm
781-
// No direct replacement, remove
781+
Messenger.Default.Reset();
782782
```
783783

784784
### Messenger Static Properties

0 commit comments

Comments
 (0)