Skip to content

Commit 5e7776f

Browse files
committed
chore: Update code snipped Line numbers, highlight and match Englisch Model ViewModel setup guide to German Localized
1 parent cb032d3 commit 5e7776f

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

docs/articles/de/Navigation/HowTo-RegisterRoutes-de.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Bevor du mit der Routen Registrierung beginnst, brauchst du noch zwei Dinge:
1818

1919
- [Neue Klasse oder Record Definitionen für ein ViewModel oder Model hinzufügen](xref:DevTKSS.Uno.Setup.HowTo-AddingNew-VM-Class-Record.de)
2020

21-
## RegisterRoutes Methode
21+
## `RegisterRoutes` Methode in `App.xaml.cs` entdecken
2222

2323
Füge die dafür benötigte Methode wie folgt in deine App Klasse unterhalb der `OnLaunched` Methode ein:
2424

25-
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L82)]
25+
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L80)]
2626

2727
## Definieren der `ViewMap`'s
2828

@@ -43,7 +43,7 @@ Wenn zusätzliche Daten Objekte bei der Navigation dieser Route erforderlich sin
4343

4444
So sieht das zum Beispiel dann in der XamlNavigationApp aus, wo ich `Entity` nicht mehr benötigt habe und diese Route entsprechend zurück konvertiert habe:
4545

46-
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L83-L89?highlight=L5)]
46+
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L82-L87?highlight=5)]
4747

4848
## Hierarchisch aufgebaute `RoutesMap`'s
4949

@@ -68,7 +68,7 @@ Nun wollen wir aber auf der `MainPage` vielleicht eine TabBar, NavigationBar, ei
6868

6969
**Das machen wir beispielsweise so:**
7070

71-
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L88-L103)]
71+
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L89-L103)]
7272

7373
Hier siehst du, dass ich:
7474

docs/articles/en/Navigation/HowTo-ModelDefinition-en.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ public partial class DashboardViewModel : ObservableObject
6464
}
6565
```
6666

67+
With this code, you can bind the `Name` property in the View and use the `NavigateSecondAsyncCommand` to navigate to the `SecondViewModel`.
68+
69+
You can use a button or another control in the View to trigger navigation, but by binding the `IsEnabled` property of the control to the `CanExecute` status of the command, you can only execute navigation when the name is not empty.
70+
6771
### [Mvux](#tab/mvux)
6872

6973
```csharp
@@ -92,8 +96,12 @@ public partial record MainModel
9296
}
9397
```
9498

95-
With this code, you can bind the `Name` property in the View and use the `NavigateSecondAsyncCommand` to navigate to the `SecondViewModel`.
99+
Here you can define a button in the View that calls the `NavigateSecondAsync` method to navigate to the `SecondModel`, retrieve the `Name` value, and pass it as data to the next page.
96100

97-
You can use a button or another control in the View to trigger navigation, but by binding the `IsEnabled` property of the control to the `CanExecute` status of the command, you can only execute navigation when the name is not empty.
101+
If you compare how this looks in MVVM and MVUX, you'll notice it's fundamentally quite similar, but in MVUX the whole thing is somehow more organized and you need less "boilerplate" code to achieve the same result.
102+
103+
To create a TwoWay binding directly on the `IState<string> Name` in the View, you don't even need a `PropertyChanged` notification like you would in MVVM. Instead, you simply attach a `.ForEach(...)` to the `.Value(...)`, create a method that receives the new value, and you can work with it directly. No more tedious implementation of `INotifyPropertyChanged`.
104+
105+
Learn more about this in the [Guide: React to Route Changes](xref:DevTKSS.Uno.ExtensionsNavigation.HowTo-ChangeRoutes.en).
98106

99107
---

docs/articles/en/Navigation/HowTo-RegisterRoutes-en.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Before you start with route registration, you need two things:
1818

1919
- [Add new class or record definitions for a ViewModel or Model](xref:DevTKSS.Uno.Setup.HowTo-AddingNew-VM-Class-Record.en)
2020

21-
## RegisterRoutes Method
21+
## Discovering `RegisterRoutes` Method in `App.xaml.cs`
2222

2323
Add the required method to your App class below the `OnLaunched` method as follows:
2424

25-
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L82)]
25+
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L80)]
2626

2727
## Defining the `ViewMap`'s
2828

@@ -40,7 +40,7 @@ If additional data objects are required when navigating this route, you convert
4040

4141
For example, this is what it looks like in the XamlNavigationApp, where I no longer needed `Entity` and converted this route back accordingly:
4242

43-
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L83-L89)]
43+
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L82-L87?highlight=5)]
4444

4545
## Hierarchically Structured `RoutesMap`'s
4646

@@ -65,7 +65,7 @@ Now, on the `MainPage`, we might want to use a TabBar, NavigationBar, a Frame wi
6565

6666
**We do this, for example, like this:**
6767

68-
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L88-L103)]
68+
[!code-csharp[](../../../../src/DevTKSS.Uno.XamlNavigationApp/App.xaml.cs#L89-L103)]
6969

7070
Here you can see that I added another page, the `DashboardPage`, and created a Model for it named `DashboardModel`. I also nested the `Second` route into the `RouteMap` of the `Main` route.
7171

0 commit comments

Comments
 (0)