Skip to content

Commit f2871cf

Browse files
authored
Merge pull request #2576 from unoplatform/dev/erli/bp/release/stable/5.0/pr-2538
Docs: Refactoring MVUX Docs #2538 (backport)
2 parents d2480b1 + b85db72 commit f2871cf

File tree

10 files changed

+371
-704
lines changed

10 files changed

+371
-704
lines changed

doc/Learn/Mvux/Advanced/Messaging.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ Here is where messaging comes in handy. The service sends a message about this e
1515

1616
The Community Toolkit messenger is a standard tool for sending and receiving messages between app objects. It enables objects to remain decoupled from each other without keeping a strong reference between the sender and the receiver. Messages can also be sent over specific channels uniquely identified by a token or within certain application areas.
1717

18+
> [!NOTE]
19+
> To ensure that the Community Toolkit Messenger works correctly, it is essential to register the `IMessenger` service in your app using the following code in `App.xaml.cs`:
20+
>
21+
> ```csharp
22+
> services.AddSingleton<IMessenger, WeakReferenceMessenger>();
23+
> ```
24+
1825
The core component of the messenger is the `IMessenger` object. Its primary methods are `Register` and `Send.` `Register` subscribes to an object to start listening to messages of a specific type, whereas `Send` sends messages to all listening parties.
1926
There are various ways to obtain the `IMessenger` object. Still, we'll use the most common one, which involves using [Dependency Injection](xref:Uno.Extensions.DependencyInjection.Overview) (DI) to register the `IMessenger` service in the app so it can then be resolved when other dependent types (e.g., ViewModels) are constructed.
2027
@@ -288,7 +295,7 @@ public partial record PeopleModel
288295
289296
The `SelectedPersonPhone` state will only be refreshed if it meets the predicate criteria, which are limited to the currently selected `Person`.
290297
291-
> ![NOTE]
298+
> [!NOTE]
292299
> The `Selection` method above picks up UI selection changes and reflects them onto a state. This subject is covered [here](xref:Uno.Extensions.Mvux.Advanced.Selection).
293300
294301
- `Observe<TOther, TEntity, TKey>(IState<TEntity> state, IFeed<TOther> other, Func<TOther, TEntity, bool> predicate, Func<TEntity, TKey> keySelector)`

doc/Learn/Mvux/Feeds.md

Lines changed: 0 additions & 225 deletions
This file was deleted.

doc/Learn/Mvux/ListFeeds.md

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)