Skip to content

Commit d08ba17

Browse files
authored
Merge branch 'master' into adding-Mvux-ListView-app
2 parents b6a946f + db60604 commit d08ba17

17 files changed

Lines changed: 258 additions & 106 deletions

File tree

README.md

Lines changed: 97 additions & 85 deletions
Large diffs are not rendered by default.
543 KB
Loading
17.2 KB
Loading

docs/articles/de/HowTo-Adding-New-VM-Class-Record-de.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ Um ein für Mvux passendes Model zu erstellen:
3636

3737
![Umbenennen-Klasse-zu-Mvux-Model](../.attachments/renaming-class-to-record-mvux.png)
3838

39+
> [!NOTE]
40+
> In Mvux werden Models als `record`-Typen definiert, um Unveränderlichkeit und wertbasierte Gleichheit zu nutzen, was für die Zustandsverwaltung in Anwendungen vorteilhaft ist.
41+
> Die Verwendung von `partial` ist in Mvux Models unerlässlich, um die vom Framework bereitgestellten Code-Generierungsfunktionen zu ermöglichen, wie z.B. automatische Eigenschaftsänderungsbenachrichtigungen und andere Reduzierungen von Boilerplate-Code.
42+
> [!CAUTION]
43+
> Genau wie bei regulären C#-Klassen können auch Mvux Models oder Services primäre Konstruktoren haben, die standardmäßig die Parameter als Eigenschaften des Record-Typs erzeugen.
44+
> Ein potenzieller Nachteil dabei ist, dass ein `INavigator`-Parameter im primären Konstruktor ebenfalls eine Eigenschaft des Models wäre, was normalerweise nicht das ist, was wir als Teil der öffentlichen API unseres Models wollen.
45+
> Du solltest bevorzugen, diese Service-definierenden Parameter in einem sekundären Konstruktor zu definieren und sie als `private readonly` Felder zu behalten.
46+
3947
### [Ein ViewModel erstellen](#tab/create-mvvm-viewmodel)
4048

4149
Um ein für Mvvm passendes ViewModel zu erstellen:
@@ -47,3 +55,6 @@ Um ein für Mvvm passendes ViewModel zu erstellen:
4755
![Konvertieren-Klasse-zu-ViewModel-Mvvm](../.attachments/converting-class-to-vm-mvvm.png)
4856

4957
---
58+
59+
> [!NOTE]
60+
> Du kannst in Uno ViewModels oder Models frei den primären Konstruktor verwenden, beachte jedoch, dass bei Verwendung von `Uno.Extensions.Navigation` keine Parameter im *Page*-Konstruktor erlaubt sind.

docs/articles/de/Introduction-de.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,21 @@ Hier ein schneller Überblick über die enthaltenen Samples. Detaillierte Infos
2929

3030
### XamlNavigationApp (Mvux)
3131

32-
- [NavigationView in MVUX oder MVVM + XAML](xref:DevTKSS.Uno.ExtensionsNavigation.Overview.de)
32+
- [NavigationView in MVUX oder MVVM + XAML - Übersicht](xref:DevTKSS.Uno.ExtensionsNavigation.Overview.de) - [Showcase Video ansehen auf Youtube](https://youtu.be/vVvnK02r2ug)
33+
- [Definieren des UI mit einer NavigationView](xref:DevTKSS.Uno.ExtensionsNavigation.HowTo-Defining-UI.de) - [Tutorial ansehen auf Youtube](https://youtu.be/knt2oOjHH30)
34+
- [Reagieren auf Routen Änderungen](xref:DevTKSS.Uno.ExtensionsNavigation.HowTo-ChangeRoutes.de) - [Tutorial ansehen auf Youtube](https://youtu.be/RZ3RirA7jhk)
3335
- [Zum Quellcode](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.XamlNavigationApp/)
3436

37+
### SimpleMemberSelectionApp
38+
39+
- **YouTube Video:** [How To: Binden von ListState und ImmutableList zu FeedView & ListView im UI](https://youtu.be/wOsSlv1YFic)
40+
- [Zum Quellcode](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.SimpleMemberSelectionApp/)
41+
42+
### MvuxListApp
43+
44+
- **YouTube Video:** [HowTo: Mvux ListState - Binden unseres UI an das Selected Item](https://youtu.be/UUa2VymR8hM)
45+
- [Zum Quellcode](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.MvuxListApp/)
46+
3547
---
3648

3749
## Weitere Ressourcen

docs/articles/de/MvuxGallery-Overview-de.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Hier ist eine Liste von Steuerelementen und Funktionen, die Sie in der MvuxGalle
7979

8080
- Lokalisierung
8181
- **IStringLocalizer**
82-
- Ressourcenwörterbücher (*Ich empfehle, diese Links mit Visual Studio 2022 zu durchsuchen*)
82+
- Ressourcenwörterbücher (*Ich empfehle, diese Links mit Visual Studio 2022/2026 zu durchsuchen*)
8383
- [en](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.Samples.MvuxGallery/Strings/en/Resources.resw)
8484
- [de](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.Samples.MvuxGallery/Strings/de/Resources.resw)
8585
- Bindung des aktuellen Werts in `IState<string>` und zur entsprechenden Ansicht

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ In der Projektdatei, zu erkennen an der Endung `.csproj`, brauchst du dafür neb
3636

3737
> [!TIP]
3838
> Das `Toolkit` Feature wird nur benötigt, wenn Navigations-Steuerelemente wie `TabBar` oder `DrawerControl` verwendet werden sollen.
39+
> [!NOTE]
40+
> Wir benötigen grundsätzlich das `Hosting` Feature und die `DependencyInjection` Funktionalität in unserer Anwendung zu verwenden.
41+
> Ich sage hier absichtlich "grundsätzlich", da ich bspw. in der hier enthaltenen `MvuxGallery` und `SimpleMemberSelectionApp` Anwendungen das `Hosting` Feature entfernt habe, die App erstellt habe und entgegen der offiziellen Dokumentation ich keine Probleme feststellen konnte.
42+
> Alle DI Parameter wurden korrekt aufgelöst und ich war weiterhin im stande `ConfigureServices` für die Registrierung von bspw. `KeyedService` in der zugehörigen `App.xaml.cs` Datei mit dem [![Uno.Sdk 6.3.28](https://img.shields.io/badge/Uno.Sdk-6.3.28-blue)](https://www.nuget.org/packages/Uno.Sdk/6.3.28) zu verwenden.
3943
4044
## App.xaml.cs Konfiguration
4145

docs/articles/en/HowTo-Adding-New-VM-Class-Record-en.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ uid: DevTKSS.Uno.Setup.HowTo-AddingNew-VM-Class-Record.en
44

55
## How To: Create a ViewModel or Model from Classes
66

7-
In this guide, we will look at how to create a new class element in Visual Studio and then create either a ViewModel or a Model for use in an Uno Platform application with **MVUX**.
7+
In this guide, we will look at how to create a new class element in Visual Studio and then create either a ViewModel or a Model for use in an Uno Platform application.
88

99
For the following steps, let's assume the page that the element to be created belongs to is called **SamplePage.xaml**
1010

@@ -16,9 +16,10 @@ For the following steps, let's assume the page that the element to be created be
1616
![Adding-new-Item-to-sln](../.attachments/Adding-new-Item-to-sln-en.png)
1717

1818
2. **Create a Class element:**
19-
1. Select the **`Class`** element in the list and name it according to the following scheme:
19+
1. Select the **`Class`** element in the list and name it according to the naming conventions:
20+
21+
Your application uses:
2022

21-
**Your application uses:**
2223
- **Mvvm:** `SampleViewModel.cs`
2324
- **Mvux:** `SampleModel.cs`
2425

@@ -36,6 +37,14 @@ To create a Model suitable for Mvux:
3637

3738
![Renaming-Class-to-Mvux-Model](../.attachments/renaming-class-to-record-mvux.png)
3839

40+
> [!NOTE]
41+
> In Mvux, Models are defined as `record` types to leverage immutability and value-based equality, which are beneficial for state management in applications.
42+
> Using `partial` is essential in Mvux Models to enable code generation features provided by the framework, such as automatic property change notifications and other boilerplate code reductions.
43+
> [!CAUTION]
44+
> Just like in regular C# classes, Mvux Models or Services can also have primary constructors, which will by default produce the parameters as properties of the record type.
45+
> A potential downside of this is, that a `INavigator` parameter in the primary constructor would also be a property of the Model, which is not what we normally want as part of our Model's public API.
46+
> You should prefer defining those Service defining parameters in a secondary constructor and keep them as `private readonly` fields.
47+
3948
### [Create a ViewModel](#tab/create-mvvm-viewmodel)
4049

4150
To create a ViewModel suitable for Mvvm:
@@ -47,3 +56,6 @@ To create a ViewModel suitable for Mvvm:
4756
![Converting-Class-to-ViewModel-Mvvm](../.attachments/converting-class-to-vm-mvvm.png)
4857

4958
---
59+
60+
> [!NOTE]
61+
> You are free to use the primary constructor in Uno ViewModels or Models, but note that using `Uno.Extensions.Navigation` you can not have parameters in the *page* constructor.

docs/articles/en/Introduction-en.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,21 @@ Here is a quick overview of the included samples. You can find detailed informat
2929

3030
### XamlNavigationApp (Mvux)
3131

32-
- [NavigationView in MVUX or MVVM + XAML](xref:DevTKSS.Uno.ExtensionsNavigation.Overview.en)
32+
- [NavigationView in MVUX or MVVM + XAML - Overview](xref:DevTKSS.Uno.ExtensionsNavigation.Overview.en) - [Watch Showcase Video on Youtube](https://youtu.be/vVvnK02r2ug)
33+
- [Defining UI with a NavigationView](xref:DevTKSS.Uno.ExtensionsNavigation.HowTo-Defining-UI.en) - [Watch Tutorial on Youtube](https://youtu.be/knt2oOjHH30)
34+
- [Responding to Route Changes](xref:DevTKSS.Uno.ExtensionsNavigation.HowTo-ChangeRoutes.en) - [Watch Tutorial on Youtube](https://youtu.be/RZ3RirA7jhk)
3335
- [View Source Code](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.XamlNavigationApp/)
3436

37+
### SimpleMemberSelectionApp
38+
39+
- **YouTube Video:** [How To: Binding ListState and ImmutableList to FeedView & ListView in UI](https://youtu.be/wOsSlv1YFic)
40+
- [View Source Code](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.SimpleMemberSelectionApp/)
41+
42+
### MvuxListApp
43+
44+
- **YouTube Video:** [HowTo: Mvux ListState - Binding our UI to the Selected Item](https://youtu.be/UUa2VymR8hM)
45+
- [View Source Code](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.MvuxListApp/)
46+
3547
---
3648

3749
## Additional Resources

docs/articles/en/MvuxGallery-Overview-en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Here is a list of Controls and Features you can explore in the MvuxGallery App w
7575

7676
- Localization
7777
- **IStringLocalizer**
78-
- Resources Dictionaries (*I recommend to lookup those links using Visual Studio 2022*)
78+
- Resources Dictionaries (*I recommend to lookup those links using Visual Studio 2022/2026*)
7979
- [en](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.Samples.MvuxGallery/Strings/en/)
8080
- [de](https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/blob/master/src/DevTKSS.Uno.Samples.MvuxGallery/Strings/de/)
8181
- Binding current value in `IState<string>` and to corresponding View

0 commit comments

Comments
 (0)