Skip to content

Commit

Permalink
Merge pull request #2576 from unoplatform/dev/erli/bp/release/stable/…
Browse files Browse the repository at this point in the history
…5.0/pr-2538

Docs: Refactoring MVUX Docs #2538 (backport)
  • Loading branch information
agneszitte authored Sep 26, 2024
2 parents d2480b1 + b85db72 commit f2871cf
Show file tree
Hide file tree
Showing 10 changed files with 371 additions and 704 deletions.
9 changes: 8 additions & 1 deletion doc/Learn/Mvux/Advanced/Messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ Here is where messaging comes in handy. The service sends a message about this e

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.

> [!NOTE]
> 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`:
>
> ```csharp
> services.AddSingleton<IMessenger, WeakReferenceMessenger>();
> ```
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.
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.
Expand Down Expand Up @@ -288,7 +295,7 @@ public partial record PeopleModel
The `SelectedPersonPhone` state will only be refreshed if it meets the predicate criteria, which are limited to the currently selected `Person`.
> ![NOTE]
> [!NOTE]
> 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).
- `Observe<TOther, TEntity, TKey>(IState<TEntity> state, IFeed<TOther> other, Func<TOther, TEntity, bool> predicate, Func<TEntity, TKey> keySelector)`
Expand Down
225 changes: 0 additions & 225 deletions doc/Learn/Mvux/Feeds.md

This file was deleted.

102 changes: 0 additions & 102 deletions doc/Learn/Mvux/ListFeeds.md

This file was deleted.

Loading

0 comments on commit f2871cf

Please sign in to comment.