Skip to content

Commit 5c263de

Browse files
committed
feat: Make ListboardModel use SampleService to show the difference to the direct implementation in the model ref DashboardModel
1 parent 6f19947 commit 5c263de

File tree

19 files changed

+390
-269
lines changed

19 files changed

+390
-269
lines changed

README.md

Lines changed: 18 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# DevTKSS Uno Samples
22

3-
Example projects to see how different things can be done in a Uno Platform App.
3+
The samples in this Repository are meant to help other Developers, independent to their pre-knowledge, get an Idea of how to use the shown things.
4+
5+
> [!TIP]
6+
> Check out the [Documentation](./doc/), for more a more detailed List and future coming Guides and Explanations.
47
58
## Table of Contents
69
1. [DevTKSS Uno Samples](#devtkss-uno-samples)
@@ -14,90 +17,46 @@ Example projects to see how different things can be done in a Uno Platform App.
1417

1518
## Mvux Gallery
1619

17-
At the [Mvux Gallery](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery) you can find:
20+
Following list provides you a quick Overview, what you can find in the [Mvux Gallery](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery) App.
1821

1922
### Controls to be explored in this App
2023

21-
- FeedView + GridView
22-
- FeedView + ListView
24+
- FeedView comined with:
25+
- GridView
26+
- ListView
2327
- DataTemplate centralized Recource definition
2428
- Card
29+
- Grid
30+
- NavigationView
2531
- `ItemOverlayTemplate` DataTemplate layout replicated from WinUI 3 Gallery
2632

2733
### Uno.Extensions to be explored here
2834

2935
- Mvux
30-
- Feed
31-
- ListFeed
32-
- State
33-
- ListState
34-
35-
--> Almost every Model, detailed overview will follow.
36-
3736
- Navigation
3837
- via Xaml
39-
- NavigationView
40-
- [MainPage.xaml](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/MainPage.xaml#L1-L50))
41-
- Via Model
42-
- (planned)
43-
44-
- Hosting
45-
- [App.xaml.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/App.xaml.cs#L21-L91)
46-
38+
- Hosting
4739
- DependencyInjection
48-
- Service Registration
49-
- [App.xaml.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/App.xaml.cs#L69-L74)
50-
- Service Definition
51-
- [CodeSampleService.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleService.cs)
52-
- [ICodeSampleService.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/ICodeSampleService.cs)
53-
- Data Model Definition
54-
- [SampleCode.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/SampleCode.cs)
55-
- [CodeSampleOption.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleOption.cs)
56-
- [CodeSampleOptionsConfiguration.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleOptionsConfiguration.cs)
57-
5840
- Serialization
5941
- JsonSerializerContext of each DataModel
60-
- [SampleCodeContext](SampleCode.cs#L8-L11)
61-
- [CodeSampleOptionsContext](CodeSampleOptions.cs#L8-L11)
62-
- [CodeSampleOptionsConfigurationContext](CodeSampleOptionsConfiguration.cs#L6-L9)
63-
6442
- Configuration
65-
- Data for Serialization
66-
- [appsettings.json](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/appsettings.json)
67-
43+
- Data for Serialization load from `appsettings.json`
6844
- Storage
69-
- Via Model
70-
- [DashboardModel.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/DashboardModel.cs#L55-L141)
45+
- Directly in the Model Definition
7146
- Via Service
72-
- [CodeSampleService.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleService.cs)
7347
- Via StorageExtension
74-
- Currently in private preview package
48+
- Referenced currently in private preview package
7549
- Via Uno.Extensions.Storage.IStorage Interface extension
7650
- added as PR to Uno.Extensions [#2734](https://github.com/unoplatform/uno.extensions/pull/2734)
77-
7851
- Localization
7952
- **IStringLocalizer**
8053
- Resources Dictionarys
81-
- [en](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Strings/en/Resources.resw)
82-
- [de](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Strings/en/Resources.resw)
83-
- Binding current value in `IState<string>` and to corresponding View
84-
- [DashboardModel.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/DashboardModel.cs#L31)
85-
- [ListboardModel.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/ListboardModel.cs#L33)
86-
- [MainModel.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/MainModel.cs#L21)
87-
- CounterModel.cs
88-
- Requesting localized Items via FeedView
89-
- Service Definition
90-
- [GalleryImageService.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/GalleryImages/GalleryImageService.cs#L34-L66)
91-
- [IGalleryImageService.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/GalleryImages/IGalleryImageService.cs#L6)
92-
- Data Model Definition
93-
- [GalleryImageModel.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/GalleryImages/GalleryImageModel.cs)
54+
- Binding current value in `IState<string>` and to corresponding View
55+
- Requesting localized Items via FeedView
9456
- **ILocalizationService**
95-
- Requesing current culture
96-
- [GalleryImageService.cs](./src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/GalleryImages/GalleryImageService.cs#L19-L30)
97-
- Switching culture
98-
- (planned)
57+
- Requesing current culture
9958

100-
### Fist Recording of Making-Of
59+
### Fist Recording of Making-Of
10160

10261
> [!NOTE]
10362
> uncut, without sound, will be edited and re-recorded in the future, src at [this commit](https://github.com/DevTKSS/DevTKSS.MvuxSampleApps/commit/8d13dcee8107324e747d828700cfd8fcf780ca37)
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
uid: DevTKSS.Uno.SampleApps.MvuxGallery.Overview
3+
_lang: en
4+
---
5+
6+
## Mvux Gallery
7+
8+
At the [Mvux Gallery](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery) you can explore the following features:
9+
10+
### Controls
11+
12+
- [FeedView + GridView](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/DashboardPage.xaml)
13+
- [FeedView + ListView](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/ListboardPage.xaml)
14+
- [DataTemplate centralized Recource Definition](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Styles/Generic.xaml)
15+
- [Card](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/SimpleCardsPage.xaml))
16+
- [`ItemOverlayTemplate` DataTemplate](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Styles/Generic.xaml#L92-L123) (*Layout replicated from WinUI 3 Gallery*)
17+
18+
### Uno.Extensions
19+
20+
- Mvux
21+
- Feed
22+
- ListFeed
23+
- State
24+
- ListState
25+
26+
--> Almost every Model, detailed overview will follow.
27+
28+
- Navigation
29+
- via Xaml
30+
- NavigationView
31+
- [MainPage.xaml](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/Views/MainPage.xaml#L1-L50))
32+
- Via Model
33+
- (planned)
34+
35+
- Hosting
36+
- [App.xaml.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/App.xaml.cs#L21-L91)
37+
38+
- DependencyInjection
39+
- Service Registration
40+
- [App.xaml.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/App.xaml.cs#L69-L74)
41+
- Service Definition
42+
- [CodeSampleService.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleService.cs)
43+
- [ICodeSampleService.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/ICodeSampleService.cs)
44+
- Data Model Definition
45+
- [SampleCode.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/SampleCode.cs)
46+
- [CodeSampleOption.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleOption.cs)
47+
- [CodeSampleOptionsConfiguration.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleOptionsConfiguration.cs)
48+
49+
- Serialization
50+
- JsonSerializerContext of each DataModel
51+
- [CodeSampleOptionsContext](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleOptions.cs#L8-L11)
52+
- [CodeSampleOptionsConfigurationContext](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleOptionsConfiguration.cs#L6-L9)
53+
54+
- Configuration
55+
- Data for Serialization
56+
- [appsettings.json](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/appsettings.json)
57+
58+
- Storage
59+
- Via Model
60+
- [DashboardModel.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/DashboardModel.cs#L55-L141)
61+
- Via Service
62+
- [CodeSampleService.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/CodeSamples/CodeSampleService.cs)
63+
- Via StorageExtension
64+
- Currently in private preview package
65+
- Via Uno.Extensions.Storage.IStorage Interface extension
66+
- added as PR to Uno.Extensions [#2734](https://github.com/unoplatform/uno.extensions/pull/2734)
67+
68+
- Localization
69+
- **IStringLocalizer**
70+
- Resources Dictionarys
71+
- [en](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Strings/en/Resources.resw)
72+
- [de](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Strings/en/Resources.resw)
73+
- Binding current value in `IState<string>` and to corresponding View
74+
- [DashboardModel.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/DashboardModel.cs#L31)
75+
- [ListboardModel.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/ListboardModel.cs#L33)
76+
- [MainModel.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Presentation/ViewModels/MainModel.cs#L21)
77+
- CounterModel.cs
78+
- Requesting localized Items via FeedView
79+
- Service Definition
80+
- [GalleryImageService.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/GalleryImages/GalleryImageService.cs#L34-L66)
81+
- [IGalleryImageService.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/GalleryImages/IGalleryImageService.cs#L6)
82+
- Data Model Definition
83+
- [GalleryImageModel.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/GalleryImages/GalleryImageModel.cs)
84+
- **ILocalizationService**
85+
- Requesing current culture
86+
- [GalleryImageService.cs](~/../src/DevTKSS.Uno.Samples/DevTKSS.Uno.Samples.MvuxGallery/Models/GalleryImages/GalleryImageService.cs#L19-L30)
87+
- Switching culture
88+
- (planned)

doc/articles/MvuxGallery/toc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/dotnet/docfx/main/schemas/toc.schema.json
2+
topicHref: Overview.md
3+
items:
4+
- name: Overview
5+
uid: DevTKSS.Uno.SampleApps.MvuxGallery.Overview
6+
href: Overview.md

doc/articles/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Getting Started

doc/articles/introduction.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
uid: DevTKSS.Uno.SampleApps.Intro
3+
_lang: en
4+
---
5+
6+
# Introduction
7+
8+
The samples in this Repository are meant to help other Developers, independent to their pre-knowledge, get an Idea of how to use the shown things.
9+
10+
## Current Samples List
11+
12+
To give you a quick overview of
13+
- [MvuxGallery](xref:DevTKSS.Uno.SampleApps.MvuxGallery.Overview) [source code:](../src/DevTKSS.Uno.Samples.MvuxGallery/)

doc/articles/toc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/dotnet/docfx/main/schemas/toc.schema.json
2+
topicHref: introduction.md
3+
items:
4+
- name: Introduction
5+
href: introduction.md
6+
- name: Sample Apps
7+
items:
8+
- name: Mvux Gallery
9+
href: MvuxGallery/

doc/docfx.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
3+
"metadata": [
4+
{
5+
"src": [
6+
{
7+
"src": "../src",
8+
"files": [
9+
"**/*.csproj"
10+
]
11+
}
12+
],
13+
"output": "api"
14+
}
15+
],
16+
"build": {
17+
"content": [
18+
{
19+
"files": [
20+
"**/*.{md,yml}"
21+
],
22+
"exclude": [
23+
"_site/**"
24+
]
25+
}
26+
],
27+
"resource": [
28+
{
29+
"files": [
30+
"images/**"
31+
]
32+
}
33+
],
34+
"output": "_site",
35+
"template": [
36+
"default",
37+
"modern"
38+
],
39+
"markdownEngineProperties": {
40+
"markdigExtensions": [
41+
"yaml",
42+
"listextras",
43+
"definitionlists",
44+
"bootstrap",
45+
"globalization",
46+
"advanced"
47+
]
48+
},
49+
"globalMetadata": {
50+
"_appName": "DevTKSS.Uno.SampleApps",
51+
"_appTitle": "DevTKSS.Uno.SampleApps",
52+
"_enableSearch": false,
53+
"pdf": false
54+
}
55+
}
56+
}

doc/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
uid: DevTKSS.Uno.SampleApps
3+
_layout: landing
4+
_lang: en
5+
---
6+
7+
# Welcome in the Documentation of my Sample Apps using Uno Platform Applications
8+
9+
The samples in this Repository are meant to help other Developers, independent to their pre-knowledge, get an Idea of how to use the shown things.
10+
11+
## Current Samples List
12+
13+
- [MvuxGallery](./articles/) [source code:](../src/DevTKSS.Uno.Samples.MvuxGallery/)

doc/toc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/dotnet/docfx/main/schemas/toc.schema.json
2+
- name: Docs
3+
href: doc/
4+
- name: API
5+
href: api/

src/DevTKSS.Uno.Samples.MvuxGallery/App.xaml.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Text.Json;
2-
using DevTKSS.Uno.Samples.MvuxGallery.Models.GalleryImages;
32
using Uno.Resizetizer;
43

54
namespace DevTKSS.Uno.Samples.MvuxGallery;
@@ -64,6 +63,9 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
6463
.EmbeddedSource<App>()
6564
.Section<AppConfig>()
6665
.Section<CodeSampleOptionsConfiguration>()
66+
.Section<CodeSampleOptionsConfiguration>("DashboardSampleConfiguration")
67+
.Section<CodeSampleOptionsConfiguration>("MainSampleConfiguration")
68+
.Section<CodeSampleOptionsConfiguration>("ListboardSampleConfiguration")
6769
)
6870
// Enable localization (see appsettings.json for supported languages)
6971
.UseLocalization()
@@ -73,14 +75,13 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
7375

7476
.AddSingleton<IGalleryImageService, GalleryImageService>()
7577
.AddSingleton<ICodeSampleService, CodeSampleService>()
76-
.AddJsonTypeInfo(SampleCodeContext.Default.SampleCode)
77-
.AddJsonTypeInfo(CodeSampleOptionContext.Default.CodeSampleOption)
78-
.AddJsonTypeInfo(CodeSampleOptionsConfigurationContext.Default.CodeSampleOptionsConfiguration)
79-
.AddSingleton(new JsonSerializerOptions { PropertyNameCaseInsensitive = true })
8078
)
8179
.UseNavigation(ReactiveViewModelMappings.ViewModelMappings, RegisterRoutes)
82-
.UseStorage()
83-
.UseSerialization()
80+
.UseSerialization((context, services) =>
81+
services
82+
.AddJsonTypeInfo(CodeSampleOptionContext.Default.CodeSampleOption)
83+
.AddJsonTypeInfo(CodeSampleOptionsConfigurationContext.Default.CodeSampleOptionsConfiguration)
84+
.AddSingleton(new JsonSerializerOptions { PropertyNameCaseInsensitive = true }))
8485
);
8586
MainWindow = builder.Window;
8687

0 commit comments

Comments
 (0)