Skip to content

Commit 4e25316

Browse files
authored
Merge pull request #2936 from unoplatform/mergify/bp/release/stable/7.0/pr-2934
2 parents 6453a01 + f98c1a9 commit 4e25316

24 files changed

+171
-164
lines changed

doc/Learn/Mvux/Walkthrough/Commands.howto.md

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ uid: Uno.Extensions.Mvux.Commands.HowTo
55

66
**Outcome:** A public method on your MVUX model shows up in the ViewModel as a command and can be bound to a `<Button>`.
77

8-
**Dependencies**
9-
10-
* `Uno.Extensions.Reactive` (or the umbrella Uno.Extensions package your app already uses)
8+
Requires the `MVUX` UnoFeature.
119

1210
**When to use**
1311

1412
* You have a model method like `Save()` or `DoWork()` and you just want a button to call it.
15-
* You dont want to hand-write an `ICommand`.
13+
* You don't want to hand-write an `ICommand`.
1614

1715
## Steps
1816

@@ -58,10 +56,6 @@ uid: Uno.Extensions.Mvux.Commands.HowTo
5856

5957
**Outcome:** Button disables while your async method runs.
6058

61-
**Dependencies**
62-
63-
* `Uno.Extensions.Reactive`
64-
6559
### Steps
6660

6761
1. **Async method on the model**
@@ -98,11 +92,7 @@ uid: Uno.Extensions.Mvux.Commands.HowTo
9892

9993
### Pass a value from the view to the model command
10094

101-
**Outcome:** You click a button and the model method receives the button’s `CommandParameter`.
102-
103-
**Dependencies**
104-
105-
* `Uno.Extensions.Reactive`
95+
**Outcome:** You click a button and the model method receives the button's `CommandParameter`.
10696

10797
### Steps
10898

@@ -152,10 +142,6 @@ uid: Uno.Extensions.Mvux.Commands.HowTo
152142

153143
**Outcome:** Your method parameter is auto-filled with the current value of a feed on the same model.
154144

155-
**Dependencies**
156-
157-
* `Uno.Extensions.Reactive`
158-
159145
### When to use
160146

161147
* You have `public IFeed<int> CounterValue => ...;`
@@ -216,10 +202,6 @@ public void ResetCounter([FeedParameter(nameof(CounterValue))] int newValue)
216202

217203
**Outcome:** Public methods stay as methods on the ViewModel; commands are not generated.
218204

219-
**Dependencies**
220-
221-
* `Uno.Extensions.Reactive`
222-
223205
### Option A – turn off on a method
224206

225207
```csharp
@@ -265,10 +247,6 @@ using Uno.Extensions.Reactive;
265247

266248
**Outcome:** Even if commands are globally disabled, this method still becomes a command.
267249

268-
**Dependencies**
269-
270-
* `Uno.Extensions.Reactive`
271-
272250
### Steps
273251

274252
1. **Disable globally**
@@ -304,11 +282,10 @@ using Uno.Extensions.Reactive;
304282

305283
**Outcome:** An event like `DoubleTapped` can trigger a generated command and pass a parameter.
306284

307-
**Dependencies**
285+
Requires:
308286

309287
* `Uno.Microsoft.Xaml.Behaviors.Interactivity.WinUI`
310288
* `Uno.Microsoft.Xaml.Behaviors.WinUI.Managed`
311-
* `Uno.Extensions.Reactive`
312289

313290
### Steps
314291

@@ -353,13 +330,9 @@ using Uno.Extensions.Reactive;
353330

354331
**Outcome:** You hand-build a command in the model for special scenarios.
355332

356-
**Dependencies**
357-
358-
* `Uno.Extensions.Reactive`
359-
360333
### When to use
361334

362-
* You need a command that doesnt come from a public method.
335+
* You need a command that doesn't come from a public method.
363336
* You want fine control over what `CanExecute` or parameters are.
364337

365338
### Example
@@ -399,10 +372,6 @@ public partial record MyModel
399372

400373
**Outcome:** Command takes the current feed value, checks a condition, then runs.
401374

402-
**Dependencies**
403-
404-
* `Uno.Extensions.Reactive`
405-
406375
### Example
407376

408377
```csharp
@@ -460,4 +429,4 @@ public IAsyncCommand MethodName { get; }
460429

461430
---
462431

463-
[1]: https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Mvux/Advanced/Commands.html?utm_source=chatgpt.com "Commands"
432+
[1]: https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Mvux/Advanced/Commands.html "Commands"

doc/Learn/Mvux/Walkthrough/FeedView.howto.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ uid: Uno.Extensions.Mvux.FeedView.HowTo
55

66
**Goal:** render the current value of an `IFeed<T>` or `IState<T>` in XAML.
77

8-
**Dependencies**
8+
Requires the `MVUX` UnoFeature.
99

10-
* NuGet: `Uno.Extensions.Reactive.UI`
11-
* XAML namespace:
10+
XAML namespace:
1211

1312
```xml
1413
<Page

doc/Learn/Mvux/Walkthrough/ListFeed.howto.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ uid: Uno.Extensions.Mvux.ListFeed.HowTo
55

66
These how-tos show how to **load a collection from a service**, **show it with `FeedView`**, and **filter it with MVUX** using Uno.Extensions.
77

8-
> **NuGet to mention (per how-to):**
9-
>
10-
> * `Uno.Extensions.Reactive`
11-
> * `Uno.Extensions.Serialization` (if you fetch from HTTP / want serialization)
12-
> * `Uno.Extensions.Http` (if later you swap to HTTP)
13-
>
14-
> For the basic in-memory examples below, **`Uno.Extensions.Reactive`** is the important one.
8+
Requires the `MVUX` UnoFeature.
159

1610
---
1711

doc/Learn/Mvux/Walkthrough/Messaging.howto.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ You have an `IListState<T>` (for example, a list of people) and a service that c
1414
* Your UI shows a **list** (`IListState<T>` / `ListState.Async(...)`).
1515
* You want **create / update / delete** to flow to the UI.
1616

17-
## Dependencies
18-
19-
* `Uno.Extensions.Reactive`
20-
* `Uno.Extensions.Reactive.Messaging` (the MVUX/messenger glue) ([Uno Platform][1])
21-
* `CommunityToolkit.Mvvm` (for `IMessenger`) ([Uno Platform][1])
17+
Requires the `MVUX` UnoFeature.
2218

2319
```csharp
2420
using CommunityToolkit.Mvvm.Messaging;
@@ -70,10 +66,7 @@ public partial record PeopleModel
7066

7167
You changed data in a service (for example, created a `Person`) and need every MVUX model that shows people to refresh.
7268

73-
### Dependencies
74-
75-
* `CommunityToolkit.Mvvm`
76-
* `Uno.Extensions.Reactive.Messaging` (for `EntityMessage<T>` and `EntityChange`) ([Uno Platform][1])
69+
Requires the `MVUX` UnoFeature.
7770

7871
```csharp
7972
using CommunityToolkit.Mvvm.Messaging;
@@ -127,9 +120,7 @@ Any model that called `messenger.Observe(...)` for `Person` will update itself i
127120

128121
Your models and services need `IMessenger`, but nothing is providing it.
129122

130-
### Dependencies
131-
132-
* `CommunityToolkit.Mvvm` (for `IMessenger`, `WeakReferenceMessenger`) ([Uno Platform][1])
123+
Requires the `MVUX` and `MVVM` UnoFeature.
133124

134125
```csharp
135126
// in App.xaml.cs or your Startup/Host builder

doc/Learn/Mvux/Walkthrough/Pagination.howto.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Use this when you just want “user scrolls → list asks for more” and your d
1111

1212
* An MVUX **feed** that implements `ISupportIncrementalLoading` (MVUX does that for you when you use paginated feeds).
1313
* A list control that knows incremental loading, like **ListView** / **GridView**. The doc page calls this the “easiest and most straight-forward” way. ([Uno Platform][1])
14-
* Package: `Uno.Extensions.Reactive` (comes with MVUX features).
14+
* Requires the `MVUX` UnoFeature.
1515

1616
### 1. Make the service accept paging
1717

@@ -210,7 +210,7 @@ Both the original MVUX doc and the Toolkit ItemsRepeater doc expose **progress /
210210

211211
Bind to `IsLoading` (see how-to #2) and show a footer spinner.
212212

213-
[1]: https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Mvux/Advanced/Pagination.html?utm_source=chatgpt.com "Pagination"
214-
[2]: https://platform.uno/docs/articles/external/uno.toolkit.ui/doc/helpers/itemsrepeater-extensions.html?utm_source=chatgpt.com "ItemsRepeater Extensions"
215-
[3]: https://platform.uno/docs/articles/external/workshops/tube-player/modules/08-Add-API-endpoints/README.html?utm_source=chatgpt.com "Module 8 - Add API endpoints"
216-
[4]: https://platform.uno/docs/articles/external/uno.extensions/doc/Overview/Mvux/FeedView.html?utm_source=chatgpt.com "The FeedView control"
213+
[1]: https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Mvux/Advanced/Pagination.html "Pagination"
214+
[2]: https://platform.uno/docs/articles/external/uno.toolkit.ui/doc/helpers/itemsrepeater-extensions.html "ItemsRepeater Extensions"
215+
[3]: https://platform.uno/docs/articles/external/workshops/tube-player/modules/08-Add-API-endpoints/README.html "Module 8 - Add API endpoints"
216+
[4]: https://platform.uno/docs/articles/external/uno.extensions/doc/Overview/Mvux/FeedView.html "The FeedView control"

doc/Learn/Mvux/Walkthrough/PushListFeed.howto.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
**Goal:** UI shows a list of stocks that keeps changing because the data is *pushed* (not polled by the UI).
44

5-
**Dependencies:**
6-
7-
* `Uno.Extensions`
8-
* `Uno.Extensions.Reactive` (for `IFeed<T>`, `IListFeed<T>`, `ListFeed`)
5+
Requires the `MVUX` UnoFeature.
96

107
**Model**
118

doc/Learn/Mvux/Walkthrough/Selection.howto.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ uid: Uno.Extensions.Mvux.Selection.HowTo
99

1010
## What you need
1111

12-
* NuGet: `Uno.Extensions.Reactive`
12+
* The `MVUX` Uno Feature.
1313
* A model that exposes an `IListFeed<Person>`
1414

1515
```csharp
@@ -34,7 +34,7 @@ public partial record PeopleModel(IPeopleService PeopleService)
3434
public IListFeed<Person> People =>
3535
ListFeed
3636
.Async(PeopleService.GetPeopleAsync)
37-
.Selection(SelectedPerson); // 👈 connects UI selection to state
37+
.Selection(SelectedPerson); // connects UI selection to state
3838
3939
public IState<Person?> SelectedPerson => State<Person?>.Empty(this);
4040
}

doc/Learn/Mvux/Walkthrough/SimpleFeed.howto.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ uid: Uno.Extensions.Mvux.SimpleFeed.HowTo
55

66
**Goal:** display a list of items that comes from a feed (MVUX `Feed<T>`).
77

8-
**Dependencies:**
9-
10-
* `Uno.Extensions`
11-
* `Uno.Extensions.Reactive` (or the meta package that brings it)
12-
* A view model using MVUX feed pattern
8+
Requires the `MVUX` UnoFeature.
139

1410
```csharp
1511
// ViewModels/ProductsViewModel.cs

doc/Learn/Mvux/Walkthrough/SimpleState.howto.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ uid: Uno.Extensions.Mvux.SimpleState.HowTo
55

66
**Goal:** load a single value from an async service into an MVUX `IState<T>` and show it in the UI.
77

8-
**Dependencies**
9-
10-
* `Uno.Extensions`
11-
* `Uno.Extensions.Reactive`
12-
* Your project created with MVUX template (any recent Uno.Extensions MVUX app is fine).
8+
Requires the `MVUX` UnoFeature.
139

1410
**Model**
1511

doc/Learn/Navigation/Walkthrough/DefineRegions.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,75 @@ Associate TabBar items with route names:
9494

9595
* When a TabBarItem is selected, the navigator displays the page corresponding to the route name.
9696

97+
## Switch content using buttons
98+
99+
Use `Navigation.Request` with relative path `RegionName` to navigate within the current page's regions.
100+
101+
```xml
102+
<Grid uen:Region.Attached="True">
103+
<Grid.RowDefinitions>
104+
<RowDefinition Height="Auto" />
105+
<RowDefinition />
106+
</Grid.RowDefinitions>
107+
108+
<!-- Button navigation to regions -->
109+
<StackPanel Orientation="Horizontal">
110+
<Button Content="Show Products"
111+
uen:Navigation.Request="Products" />
112+
<Button Content="Show Favorites"
113+
uen:Navigation.Request="Favorites" />
114+
</StackPanel>
115+
116+
<!-- Region content -->
117+
<Grid Grid.Row="1"
118+
uen:Region.Attached="True"
119+
uen:Region.Navigator="Visibility">
120+
<Grid uen:Region.Name="Products" Visibility="Collapsed">
121+
<!-- Products content -->
122+
</Grid>
123+
<Grid uen:Region.Name="Favorites" Visibility="Collapsed">
124+
<!-- Favorites content -->
125+
</Grid>
126+
</Grid>
127+
</Grid>
128+
```
129+
130+
## Navigate from ItemsRepeater item click
131+
132+
Use `Navigation.Request` directly on ItemsRepeater to navigate to regions when an item is clicked.
133+
134+
```xml
135+
<Grid uen:Region.Attached="True">
136+
<Grid.ColumnDefinitions>
137+
<ColumnDefinition Width="Auto" />
138+
<ColumnDefinition />
139+
</Grid.ColumnDefinitions>
140+
141+
<!-- ItemsRepeater with direct navigation -->
142+
<ItemsRepeater ItemsSource="{Binding Categories}"
143+
uen:Navigation.Request="CategoryDetails">
144+
<ItemsRepeater.ItemTemplate>
145+
<DataTemplate x:DataType="models:Category">
146+
<StackPanel Margin="0,0,0,4">
147+
<TextBlock Text="{Binding Name}" />
148+
</StackPanel>
149+
</DataTemplate>
150+
</ItemsRepeater.ItemTemplate>
151+
</ItemsRepeater>
152+
153+
<!-- Region content -->
154+
<Grid Grid.Column="1"
155+
uen:Region.Attached="True"
156+
uen:Region.Navigator="Visibility">
157+
<Grid uen:Region.Name="CategoryDetails" Visibility="Collapsed">
158+
<!-- Category details content -->
159+
</Grid>
160+
</Grid>
161+
</Grid>
162+
```
163+
164+
Clicked item is automatically passed as navigation data to the region.
165+
97166
## Using Regions with NavigationView
98167

99168
Same principles apply:

0 commit comments

Comments
 (0)