diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..f8eb0a440
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,13 @@
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+charset = utf-8
+trim_trailing_whitespace = false
+insert_final_newline = false
+
+[*.md]
+indent_size = 2
+trim_trailing_whitespace = true
+insert_final_newline = true
diff --git a/README.md b/README.md
index c40360948..98a91f227 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,12 @@
+---
+uid: Uno.Samples.Readme
+---
# Uno Platform Samples
This repository provides simple, to-the-point code [samples](#samples) for the [Uno Platform](https://platform.uno/).
-
+
Pixel-Perfect. Multi-Platform. C# & Windows XAML. Today.
@@ -29,9 +32,10 @@ Visit [our documentation](https://aka.platform.uno/uno-docs-intro) for more deta
## Samples
-See a complete list of code samples [here](doc/samples.md). Some of the samples have accompanying step-by-step [workshops](https://aka.platform.uno/counter-tutorial) or [tutorials](https://aka.platform.uno/tutorials-intro) in the official Uno Platform documentation.
+See a complete list of code samples [here](xref:Uno.Samples). Some of the samples have accompanying step-by-step [workshops](https://aka.platform.uno/counter-tutorial) or [tutorials](https://aka.platform.uno/tutorials-intro) in the official Uno Platform documentation.
### Uno Platform Samples - Issues
+
If you encounter any issues with these samples above, please open an issue [here](https://github.com/unoplatform/uno/issues).
## Have other questions? Feature requests? Issues?
@@ -39,6 +43,7 @@ If you encounter any issues with these samples above, please open an issue [here
Make sure to visit our [FAQ](https://aka.platform.uno/uno-faq), [create an issue](https://github.com/unoplatform/uno/issues), [open a GitHub Discussion](https://github.com/unoplatform/uno/discussions) or visit our [Discord Server](https://platform.uno/uno-discord) - where our engineering team and community will be able to help you.
## Contributors
+
Thanks go to these wonderful people (List made with [contrib.rocks](https://contrib.rocks)):
[](https://github.com/unoplatform/Uno.Samples/graphs/contributors)
diff --git a/doc/samples.md b/doc/samples.md
index 49305450e..2381424d3 100644
--- a/doc/samples.md
+++ b/doc/samples.md
@@ -13,7 +13,7 @@ Browse the complete list below:
### Counter App
Experience the simplicity and power of Uno.Extensions through the Counter App, a straightforward yet powerful demonstration of both basic and advanced features of the Uno Platform. This app provides a hands-on experience with fundamental concepts such as state management, user interaction, and real-time UI updates.
-This sample app was built using the four variants of the [Counter workshop](https://aka.platform.uno/counter-tutorial), combining markup language (XAML or C# Markup) and presentation framework (MVVM or MVUX).
+This sample app was built using the four variants of the [Counter workshop](xref:Uno.Workshop.Counter), combining markup language (XAML or C# Markup) and presentation framework (MVVM or MVUX).
[Browse source](https://github.com/unoplatform/Uno.Samples/tree/master/reference/Counter)
@@ -25,7 +25,7 @@ The SimpleCalc App is a sample application designed to perform basic arithmetic
### TubePlayer App
-The TubePlayer App is a sample application that allows users to search for, and stream Youtube videos. This app was created using the tools, libraries, and patterns provided by the Uno Platform, designed to facilitate the rapid development of high-quality applications.
+The TubePlayer App is a sample application that allows users to search for, and stream YouTube videos. This app was created using the tools, libraries, and patterns provided by the Uno Platform, designed to facilitate the rapid development of high-quality applications.
This sample app was built following the [Tube Player workshop](https://aka.platform.uno/tubeplayer-workshop).
[Browse source](https://github.com/unoplatform/Uno.Samples/tree/master/reference/TubePlayer)
@@ -38,13 +38,14 @@ The [Chefs app](xref:Uno.Chefs.Overview) is an engaging recipe platform where yo
### Commerce App
-The Commerce App is a sample application that demonstrates the use of ListFeed pagination, Feedviews, and other features provided by Uno.Extensions. It illustrates how these features can be applied to create an application complete with a shopping cart, products, and more.
+The Commerce App is a sample application that demonstrates the use of ListFeed pagination, FeedViews, and other features provided by Uno.Extensions. It illustrates how these features can be applied to create an application complete with a shopping cart, products, and more.
[Browse source](https://github.com/unoplatform/Uno.Samples/tree/master/reference/Commerce)
### ToDo App
Dive into the essentials of task management with the ToDo App, a meticulously crafted sample application that highlights the power and flexibility of Uno.Extensions. By emphasizing the creation and organization of to-do lists, this app showcases practical applications of essential Uno.Extensions features, offering a hands-on experience in crafting responsive and user-friendly interfaces across multiple platforms.
+This Sample App Contents can be reviewed [here](xref:Uno.Workshops.ToDo-App.Overview)
[Browse source](https://github.com/unoplatform/Uno.Samples/tree/master/reference/ToDo)
@@ -84,7 +85,7 @@ An implementation of the .NET Benchmark Control, a performance comparison tool.
A sample that allows the user to search for nearby Bluetooth connections and connect to a device of their choice. Uses [InTheHand.BluetoothLE](https://www.nuget.org/packages/InTheHand.BluetoothLE).
-[Browse source](https://github.com/unoplatform/Uno.Samples/tree/master/UI/BluetoothExplorer)
+[Browse source](https://github.com/unoplatform/Uno.Samples/tree/master/UI/BluetoothExplorer)
### Camera Capture UI
@@ -336,15 +337,15 @@ Uno PongWars is a simple minigame that draws inspiration from the [PongWars HTML
Three sample apps are available:
-1. **Quickstart sample**
+1. **Quickstart sample**
This sample app was created by following the [ScottPlot Uno Platform Quickstart documentation](https://scottplot.net/quickstart/unoplatform).
-2. **Signal plot with 5 million points sample**
- This sample app was created the same way by following the [ScottPlot Uno Platform Quickstart documentation](https://scottplot.net/quickstart/unoplatform).
+2. **Signal plot with 5 million points sample**
+ This sample app was created the same way by following the [ScottPlot Uno Platform Quickstart documentation](https://scottplot.net/quickstart/unoplatform).
Only the code-behind differs to display a signal plot with 5 million random points.
-3. **SQLite Data Persistence and Large Dataset Visualization Sample**
- This sample demonstrates how to combine SQLite for database-driven data persistence with ScottPlot for visualizing large datasets.
+3. **SQLite Data Persistence and Large Dataset Visualization Sample**
+ This sample demonstrates how to combine SQLite for database-driven data persistence with ScottPlot for visualizing large datasets.
It showcases how to handle and visualize different plot types while persisting the data in a database for long-term storage.
[Browse source](https://github.com/unoplatform/Uno.Samples/tree/master/UI/ScottPlot) | [Follow the quickstart tutorial](https://scottplot.net/quickstart/unoplatform)
diff --git a/reference/Commerce/src/global.json b/reference/Commerce/src/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/Commerce/src/global.json
+++ b/reference/Commerce/src/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/Counter/CSharp-MVUX/global.json b/reference/Counter/CSharp-MVUX/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/Counter/CSharp-MVUX/global.json
+++ b/reference/Counter/CSharp-MVUX/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/Counter/CSharp-MVVM/global.json b/reference/Counter/CSharp-MVVM/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/Counter/CSharp-MVVM/global.json
+++ b/reference/Counter/CSharp-MVVM/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/Counter/README.md b/reference/Counter/Overview.md
similarity index 91%
rename from reference/Counter/README.md
rename to reference/Counter/Overview.md
index 8127f7226..7de20d2e0 100644
--- a/reference/Counter/README.md
+++ b/reference/Counter/Overview.md
@@ -1,3 +1,6 @@
+---
+uid: Uno.Workshops.Counter.Overview
+---
# Counter App
Discover the simplicity and power of Uno.Extensions with the Counter App, a straightforward yet powerful demonstration of basic and advanced features of the Uno Platform. This app provides a hands-on experience with fundamental concepts such as state management, user interaction, and UI updates in real-time.
@@ -20,4 +23,4 @@ This sample app was built using the four variants of the [Counter workshop](http
## What is the Uno Platform
[Uno Platform](https://platform.uno) is an open-source .NET platform for building single codebase native mobile, web, desktop, and embedded apps quickly.
-For additional information about Uno Platform or if you have any feedback to share, please refer to the [README.md](../../README.md) file in this Samples repository.
\ No newline at end of file
+For additional information about Uno Platform or if you have any feedback to share, please refer to the [README.md](xref:Uno.Samples.Readme) file in this Samples repository.
diff --git a/reference/Counter/XAML-MVUX/global.json b/reference/Counter/XAML-MVUX/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/Counter/XAML-MVUX/global.json
+++ b/reference/Counter/XAML-MVUX/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/Counter/XAML-MVVM/global.json b/reference/Counter/XAML-MVVM/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/Counter/XAML-MVVM/global.json
+++ b/reference/Counter/XAML-MVVM/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/SimpleCalc/CSharp-MVUX/global.json b/reference/SimpleCalc/CSharp-MVUX/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/SimpleCalc/CSharp-MVUX/global.json
+++ b/reference/SimpleCalc/CSharp-MVUX/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/SimpleCalc/CSharp-MVVM/global.json b/reference/SimpleCalc/CSharp-MVVM/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/SimpleCalc/CSharp-MVVM/global.json
+++ b/reference/SimpleCalc/CSharp-MVVM/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/SimpleCalc/XAML-MVUX/global.json b/reference/SimpleCalc/XAML-MVUX/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/SimpleCalc/XAML-MVUX/global.json
+++ b/reference/SimpleCalc/XAML-MVUX/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/SimpleCalc/XAML-MVVM/global.json b/reference/SimpleCalc/XAML-MVVM/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/SimpleCalc/XAML-MVVM/global.json
+++ b/reference/SimpleCalc/XAML-MVVM/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/ToDo/Overview.md b/reference/ToDo/Overview.md
new file mode 100644
index 000000000..612944b55
--- /dev/null
+++ b/reference/ToDo/Overview.md
@@ -0,0 +1,30 @@
+---
+uid: Uno.Workshops.ToDo-App.Overview
+---
+# ToDo App
+
+
+
+
+
+Uno ToDo is a beautifully designed sample app for [Uno Platform](https://platform.uno/) using the latest [Material Design 3 system](https://m3.material.io/).
+
+The design template makes it easy to jump-start or learn Uno Platform-powered mobile, web, and desktop applications. The app provides common functions such as logging on, recording tasks, adding due dates, setting reminders, and more.
+
+In addition, the sample code utilizes [Uno.Extensions](https://aka.platform.uno/uno-extensions) and establishes the best practices for cross-platform application design and development considering multiple screen sizes, accessibility, enforcing brand guidelines, and more.
+
+
+
+## Table of Contents
+
+* [Accessing tokens with Authentication](xref:Uno.Workshops.ToDo-App.AccessingAuthTokens)
+* [Common Navigation](xref:Uno.Workshops.ToDo-App.Common-Navigation)
+* [Changing the language with Localization via the model](xref:Uno.Workshops.ToDo-App.LocalizeByModel).
+* [Adapting the language in the Xaml with Localization via `x:Uid`](xref:Uno.Workshops.ToDo-App.LocalizeWithUid)
+* [Theme switching with ThemeService](xref:Uno.Workshops.ToDo-App.Theme-Switching-by-ThemeService)
+* [Reactive ListFeeds with FeedViews](xref:Uno.Workshops.ToDo-App.Reactive-ListFeed-FeedView)
+
+## What is the Uno Platform
+
+[Uno Platform](https://platform.uno) is an open-source .NET platform for building single codebase native mobile, web, desktop, and embedded apps quickly.
+For additional information about Uno Platform or if you have any feedback to share, please refer to the [README.md](xref:Uno.Samples.Readme) file in this Samples repository.
diff --git a/reference/ToDo/README.md b/reference/ToDo/README.md
deleted file mode 100644
index 0b647325f..000000000
--- a/reference/ToDo/README.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# ToDo App
-
-
-
-
-
-Uno ToDo is a beautifully designed sample app for [Uno Platform](https://platform.uno/) using the latest [Material Design 3 system](https://m3.material.io/).
-
-The design template makes it easy to jump-start or learn Uno Platform-powered mobile, web, and desktop applications. The app provides common functions such as logging on, recording tasks, adding due dates, setting reminders, and more.
-
-In addition, the sample code utilizes [Uno.Extensions](https://aka.platform.uno/uno-extensions) and establishes the best practices for cross-platform application design and development considering multiple screen sizes, accessibility, enforcing brand guidelines, and more.
-
-
-
-## Codebase
-
-* [**WelcomeViewModel.cs**](src/ToDo/Presentation/WelcomeViewModel.cs) accessing tokens with Authentication.
-* [**TaskListViewModel.cs**](src/ToDo/Presentation/TaskListViewModel.cs) common Navigation methods.
-* [**HomeViewModel.cs**](src/ToDo/Presentation/HomeViewModel.cs) changing the language with Localization via the model.
-* [**TaskListPage.xaml**](src/ToDo/Views/TaskListPage.xaml) adapting the language in the Xaml with Localization via `x:Uid`.
-* [**SettingsViewModel.cs**](src/ToDo/Presentation/SettingsViewModel.cs) theme switching with ThemeService.
-* [**TaskListViewModel.cs**](src/ToDo/Presentation/TaskListViewModel.cs) Reactive ListFeeds with [**TaskListPage.xaml**](src/ToDo/Views/TaskListPage.xaml) FeedViews.
-
-
-## What is the Uno Platform
-
-[Uno Platform](https://platform.uno) is an open-source .NET platform for building single codebase native mobile, web, desktop, and embedded apps quickly.
-For additional information about Uno Platform or if you have any feedback to share, please refer to the [README.md](../../README.md) file in this Samples repository.
\ No newline at end of file
diff --git a/reference/ToDo/doc/accessing-auth-tokens.md b/reference/ToDo/doc/accessing-auth-tokens.md
new file mode 100644
index 000000000..910b4a704
--- /dev/null
+++ b/reference/ToDo/doc/accessing-auth-tokens.md
@@ -0,0 +1,6 @@
+---
+uid: Uno.Workshops.ToDo-App.AccessingAuthTokens
+---
+# Accessing Tokens with Authentication
+
+[!code-csharp[](../src/ToDo/Presentation/WelcomeViewModel.cs)]
diff --git a/reference/ToDo/doc/common-navigation.md b/reference/ToDo/doc/common-navigation.md
new file mode 100644
index 000000000..3e3db61ae
--- /dev/null
+++ b/reference/ToDo/doc/common-navigation.md
@@ -0,0 +1,16 @@
+---
+uid: Uno.Workshops.ToDo-App.Common-Navigation
+---
+# Common Navigation
+
+## The Task Page
+
+[!code-xaml[](../src/ToDo/Views/TaskListPage.xaml)]
+
+## Code-Behind of List Page
+
+[!code-xaml[](../src/ToDo/Views/TaskListPage.xaml.cs)]
+
+## View Model of Task Page
+
+[!code-csharp[](../src/ToDo/Presentation/TaskListViewModel.cs)]
diff --git a/reference/ToDo/doc/localize-by-model.md b/reference/ToDo/doc/localize-by-model.md
new file mode 100644
index 000000000..9855e45c3
--- /dev/null
+++ b/reference/ToDo/doc/localize-by-model.md
@@ -0,0 +1,17 @@
+---
+uid: Uno.Workshops.ToDo-App.LocalizeByModel
+---
+
+# Changing App Localization from Model
+
+## The Home Page
+
+[!code-xaml[](../src/ToDo/Views/HomePage.xaml)]
+
+## Code-Behind of Home Page
+
+[!code-csharp[](../src/ToDo/Views/HomePage.xaml.cs)]
+
+## View Model of Home Page
+
+[!code-csharp[](../src/ToDo/Presentation/HomeViewModel.cs)]
diff --git a/reference/ToDo/doc/localize-with-uid.md b/reference/ToDo/doc/localize-with-uid.md
new file mode 100644
index 000000000..6c36a3703
--- /dev/null
+++ b/reference/ToDo/doc/localize-with-uid.md
@@ -0,0 +1,16 @@
+---
+uid: Uno.Workshops.ToDo-App.LocalizeWithUid
+---
+# Localize with using x:Uid
+
+## The TaskList Page
+
+[!code-xaml[](../src/ToDo/Views/TaskListPage.xaml)]
+
+## Code-Behind of TaskList Page
+
+[!code-csharp[](../src/ToDo/Views/TaskListPage.xaml.cs)]
+
+## View Model of TaskList Page
+
+[!code-csharp[](../src/ToDo/Presentation/TaskListViewModel.cs)]
diff --git a/reference/ToDo/doc/reactive-listfeed-listview.md b/reference/ToDo/doc/reactive-listfeed-listview.md
new file mode 100644
index 000000000..6c52874dc
--- /dev/null
+++ b/reference/ToDo/doc/reactive-listfeed-listview.md
@@ -0,0 +1,13 @@
+---
+uid: Uno.Workshops.ToDo-App.Reactive-ListFeed-FeedView
+---
+
+# Reactive ListFeeds with FeedView
+
+## Task List Page
+
+[!code-xaml[](../src/ToDo/Views/TaskListPage.xaml)]
+
+## Model of Task List Page
+
+[!code-csharp[](../src/ToDo/Presentation/TaskListViewModel.cs)]
diff --git a/reference/ToDo/doc/serialize-json-for-options.md b/reference/ToDo/doc/serialize-json-for-options.md
new file mode 100644
index 000000000..05a5dbfe6
--- /dev/null
+++ b/reference/ToDo/doc/serialize-json-for-options.md
@@ -0,0 +1,38 @@
+---
+uid: Uno.Workshops.ToDo-App.SerializeJsonForOptions
+---
+# Serialize Records loaded by Options
+
+## Immutability with IOptions
+
+
+
+### Not like this
+
+This full immutable Record definition does not work in case we want to use it to be serialized from `appsettings.json` and load it via Options, even with all parameters marked as Nullable like this:
+
+```csharp
+internal record Auth(string? ApplicationId, string[]? Scopes, string? RedirectUri, string? KeychainSecurityGroup);
+```
+
+## Possible Errors
+
+It would mark this part in the App HostBuilder:
+
+[!code-csharp[](../src/ToDo/App.xaml.cs#L59-L70?highlight=65)]
+
+With one of this Error Messages:
+
+```plaintext
+IOptions requires the type T to have a parameterless constructor so that it can be instantiated and populated with values from the configuration source. A fully immutable record does not have a parameterless constructor because all properties must be initialized in the constructor.
+```
+
+```plaintext
+IOptions uses setters to populate the properties with values. In a fully immutable record, the properties are read-only (get-only), meaning they cannot be modified after initialization.
+```
+
+Which would both result in an `System.InvalidOperationException` not allowing us to even build our Application.
+
+## Related Pages
+
+* [How To: Uno.Extensions.Serialization](https://aka.platform.uno/docs/articles/external/uno.extensions/doc/Learn/Serialization/HowTo-Serialization.html)
diff --git a/reference/ToDo/doc/theme-switching-with-theme-service.md b/reference/ToDo/doc/theme-switching-with-theme-service.md
new file mode 100644
index 000000000..a2f1047bc
--- /dev/null
+++ b/reference/ToDo/doc/theme-switching-with-theme-service.md
@@ -0,0 +1,8 @@
+---
+uid: Uno.Workshops.ToDo-App.Theme-Switching-by-ThemeService
+---
+# Theme Switching with Theme Service
+
+## The View Model
+
+[!code-csharp[](../src/ToDo/Presentation/SettingsViewModel.cs)]
diff --git a/reference/ToDo/src/Directory.Packages.props b/reference/ToDo/src/Directory.Packages.props
index a34a9353a..ea794e981 100644
--- a/reference/ToDo/src/Directory.Packages.props
+++ b/reference/ToDo/src/Directory.Packages.props
@@ -6,6 +6,6 @@
See https://aka.platform.uno/using-uno-sdk#implicit-packages for more information regarding the Implicit Packages.
-->
-
+
diff --git a/reference/ToDo/src/ToDo/App.xaml.cs b/reference/ToDo/src/ToDo/App.xaml.cs
index e5386e0a7..db7655c24 100644
--- a/reference/ToDo/src/ToDo/App.xaml.cs
+++ b/reference/ToDo/src/ToDo/App.xaml.cs
@@ -26,6 +26,36 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
// Switch to Development environment when running in DEBUG
.UseEnvironment(Environments.Development)
#endif
+ .UseLogging(configure: (context, logBuilder) =>
+ {
+ // Configure log levels for different categories of logging
+ logBuilder
+ .SetMinimumLevel(
+ context.HostingEnvironment.IsDevelopment() ?
+ Microsoft.Extensions.Logging.LogLevel.Information :
+ Microsoft.Extensions.Logging.LogLevel.Warning)
+
+ // Default filters for core Uno Platform namespaces
+ .CoreLogLevel(Microsoft.Extensions.Logging.LogLevel.Warning);
+
+ // Uno Platform namespace filter groups
+ // Uncomment individual methods to see more detailed logging
+ //// Generic Xaml events
+ //logBuilder.XamlLogLevel(LogLevel.Debug);
+ //// Layout specific messages
+ //logBuilder.XamlLayoutLogLevel(LogLevel.Debug);
+ //// Storage messages
+ //logBuilder.StorageLogLevel(LogLevel.Debug);
+ //// Binding related messages
+ //logBuilder.XamlBindingLogLevel(LogLevel.Debug);
+ //// Binder memory references tracking
+ //logBuilder.BinderMemoryReferenceLogLevel(LogLevel.Debug);
+ //// DevServer and HotReload related
+ //logBuilder.HotReloadCoreLogLevel(LogLevel.Information);
+ //// Debug JS interop
+ //logBuilder.WebAssemblyLogLevel(LogLevel.Debug);
+
+ }, enableUnoLogging: true)
.UseConfiguration(configure: configBuilder =>
configBuilder
// Load configuration information from appconfig.json
@@ -41,7 +71,12 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
// Enable localization (see appsettings.json for supported languages)
.UseLocalization()
// Register Json serializers (ISerializer and ISerializer)
- .UseSerialization()
+ .UseSerialization(services =>
+ {
+ services
+ .AddJsonTypeInfo(AuthJsonContext.Default.Auth)
+ .AddSingleton(new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
+ })
.ConfigureServices(
(context, services) => {
var section = context.Configuration.GetSection(nameof(Mock));
diff --git a/reference/ToDo/src/ToDo/Business/AuthenticationService.cs b/reference/ToDo/src/ToDo/Business/AuthenticationService.cs
index 84968eb38..4d2fb7272 100644
--- a/reference/ToDo/src/ToDo/Business/AuthenticationService.cs
+++ b/reference/ToDo/src/ToDo/Business/AuthenticationService.cs
@@ -1,5 +1,4 @@
namespace ToDo.Business;
-
public class AuthenticationService : IAuthenticationService
{
private readonly IPublicClientApplication _pca;
@@ -15,7 +14,6 @@ public AuthenticationService(
_logger = logger;
var authSettings = settings.Value;
_scopes = authSettings.Scopes ?? new string[] { };
-
var redirectUri = authSettings.RedirectUri;
if (redirectUri is "%WAB%")
{
@@ -46,7 +44,7 @@ public async Task GetAccessToken(CancellationToken ct = default)
return result?.AccessToken ?? string.Empty;
}
- public async Task GetCurrentUserAsync() => _user;
+ public async Task GetCurrentUserAsync() => await Task.FromResult(_user);
public async Task AuthenticateAsync(IDispatcher dispatcher)
{
@@ -82,12 +80,12 @@ public async Task SignOutAsync()
}
await _pca.RemoveAsync(firstAccount);
- _logger.LogInformation($"Removed account: {firstAccount.Username}, user succesfully logged out.");
+ _logger.LogInformation("Removed account: {uName}, user succesfully logged out.", firstAccount.Username);
}
private UserContext CreateContextFromAuthResult(AuthenticationResult authResult)
{
- var token = new JwtSecurityTokenHandler().ReadJwtToken(authResult.IdToken);
+ var token = new JsonWebTokenHandler().ReadJsonWebToken(authResult.IdToken);
return new UserContext
{
Name = token.Claims.First(c => c.Type.Equals("name")).Value,
@@ -113,7 +111,7 @@ private async ValueTask AcquireInteractiveTokenAsync(IDisp
return await dispatcher.ExecuteAsync(async ct => await _pca
.AcquireTokenInteractive(_scopes)
.WithUnoHelpers()
- .ExecuteAsync());
+ .ExecuteAsync(ct));
}
@@ -130,15 +128,15 @@ private async ValueTask AcquireInteractiveTokenAsync(IDisp
if (accounts.Any())
{
- _logger.LogInformation($"Number of Accounts: {accounts.Count()}");
+ _logger.LogInformation("Number of Accounts: {accountCount}",accounts.Count());
}
try
{
_logger.LogInformation("Attempting to perform silent sign in . . .");
- _logger.LogInformation($"Authentication Scopes: {JsonSerializer.Serialize(_scopes)}");
+ _logger.LogInformation("Authentication Scopes: {scope}", JsonSerializer.Serialize(_scopes, AuthJsonContext.Default.StringArray));
- _logger.LogInformation($"Account Name: {firstAccount.Username}");
+ _logger.LogInformation("Account Name: {firstAccountUsername}",firstAccount.Username);
return await _pca
.AcquireTokenSilent(_scopes, firstAccount)
diff --git a/reference/ToDo/src/ToDo/Configuration/Auth.cs b/reference/ToDo/src/ToDo/Configuration/Auth.cs
index 437e7b4d3..c196da834 100644
--- a/reference/ToDo/src/ToDo/Configuration/Auth.cs
+++ b/reference/ToDo/src/ToDo/Configuration/Auth.cs
@@ -1,9 +1,14 @@
-namespace ToDo.Configuration;
+namespace ToDo.Configuration;
+//
public partial record Auth
{
- public string? ApplicationId { get; init; }
- public string[]? Scopes { get; init; }
- public string? RedirectUri { get; init; }
- public string? KeychainSecurityGroup { get; init; }
+ public string? ApplicationId { get; init; }
+ public string[]? Scopes { get; init; }
+ public string? RedirectUri { get; init; }
+ public string? KeychainSecurityGroup { get; init; }
}
+
+[JsonSerializable(typeof(Auth))]
+internal partial class AuthJsonContext : JsonSerializerContext
+{ }
diff --git a/reference/ToDo/src/ToDo/GlobalUsings.cs b/reference/ToDo/src/ToDo/GlobalUsings.cs
index 71058a52d..a38629c78 100644
--- a/reference/ToDo/src/ToDo/GlobalUsings.cs
+++ b/reference/ToDo/src/ToDo/GlobalUsings.cs
@@ -4,7 +4,8 @@
global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
global using System.Diagnostics.Contracts;
global using System.Globalization;
-global using System.IdentityModel.Tokens.Jwt;
+global using Microsoft.IdentityModel.JsonWebTokens;
+global using Microsoft.IdentityModel.Tokens;
global using System.Linq;
global using System.Runtime.CompilerServices;
global using System.Text.Json;
diff --git a/reference/ToDo/src/ToDo/Package.appxmanifest b/reference/ToDo/src/ToDo/Package.appxmanifest
index b4bceb306..e321df891 100644
--- a/reference/ToDo/src/ToDo/Package.appxmanifest
+++ b/reference/ToDo/src/ToDo/Package.appxmanifest
@@ -27,8 +27,8 @@
+ Executable="ToDo-App.exe"
+ EntryPoint="ToDo-App">
diff --git a/reference/ToDo/src/ToDo/Platforms/Desktop/Program.cs b/reference/ToDo/src/ToDo/Platforms/Desktop/Program.cs
index 9d5d8e057..886b31609 100644
--- a/reference/ToDo/src/ToDo/Platforms/Desktop/Program.cs
+++ b/reference/ToDo/src/ToDo/Platforms/Desktop/Program.cs
@@ -7,7 +7,7 @@ public class Program
[STAThread]
public static void Main(string[] args)
{
- App.InitializeLogging();
+ // App.InitializeLogging();
var host = UnoPlatformHostBuilder.Create()
.App(() => new App())
diff --git a/reference/ToDo/src/ToDo/Properties/launchSettings.json b/reference/ToDo/src/ToDo/Properties/launchSettings.json
index bc0096ad6..e8df21ee5 100644
--- a/reference/ToDo/src/ToDo/Properties/launchSettings.json
+++ b/reference/ToDo/src/ToDo/Properties/launchSettings.json
@@ -35,6 +35,16 @@
"ToDo (WinAppSDK Packaged)": {
"commandName": "MsixPackage",
"compatibleTargetFramework": "windows"
+ },
+ "ToDo (Desktop)": {
+ "commandName": "Project",
+ "compatibleTargetFramework": "desktop"
+ },
+ "ToDo (Desktop WSL2)": {
+ "commandName": "WSL2",
+ "commandLineArgs": "{ProjectDir}/bin/Debug/net9.0-desktop/ToDo-App.dll",
+ "distributionName": "",
+ "compatibleTargetFramework": "desktop"
}
}
}
diff --git a/reference/ToDo/src/ToDo/ReadMe.md b/reference/ToDo/src/ToDo/ReadMe.md
index 93482da23..0d6778bdd 100644
--- a/reference/ToDo/src/ToDo/ReadMe.md
+++ b/reference/ToDo/src/ToDo/ReadMe.md
@@ -1,7 +1,15 @@
-# Getting Started
+---
+uid: Uno.Workshops.ToDo-App.InApp.Getting-Started
+---
-Welcome to the Uno Platform!
+
-To discover how to get started with your new app: https://aka.platform.uno/get-started
+# Welcome to this ToDo-App Sample created with Uno Platform!
-For more information on how to use the Uno.Sdk or upgrade Uno Platform packages in your solution: https://aka.platform.uno/using-uno-sdk
\ No newline at end of file
+## Getting Started
+
+To discover how to get started with new apps in general, visit: https://aka.platform.uno/get-started
+
+For more information on how to use the Uno.Sdk or upgrade Uno Platform packages in your solution: https://aka.platform.uno/using-uno-sdk
+
+The check out the complete Tutorial Guide to this ToDo-App, follow [this Link](xref:Uno.Workshops.ToDo-App.Overview) instead!
diff --git a/reference/ToDo/src/ToDo/ServiceCollectionExtensions.cs b/reference/ToDo/src/ToDo/ServiceCollectionExtensions.cs
index f8cd93b8c..4e702e8a3 100644
--- a/reference/ToDo/src/ToDo/ServiceCollectionExtensions.cs
+++ b/reference/ToDo/src/ToDo/ServiceCollectionExtensions.cs
@@ -12,8 +12,6 @@ public static IServiceCollection AddEndpoints(
bool useMocks=false)
{
_ = services
- // TEMP - this hsould be the default serialization options for content serialization > uno.extensions
- .AddSingleton(new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault })
.AddNativeHandler(context)
.AddContentSerializer(context)
.AddRefitClient(context, name: nameof(ITaskEndpoint))
diff --git a/reference/ToDo/src/ToDo/ToDo.csproj b/reference/ToDo/src/ToDo/ToDo.csproj
index 94535239f..5f37679c4 100644
--- a/reference/ToDo/src/ToDo/ToDo.csproj
+++ b/reference/ToDo/src/ToDo/ToDo.csproj
@@ -1,6 +1,6 @@
-
+
- net9.0-android;net9.0-ios;net9.0-windows10.0.26100;net9.0-browserwasm
+ net9.0-desktop;net9.0-android;net9.0-ios;net9.0-windows10.0.26100;net9.0-browserwasm
Exe
true
@@ -49,7 +49,7 @@
-
+
diff --git a/reference/ToDo/src/global.json b/reference/ToDo/src/global.json
index 00cc18b93..c78bc4b8f 100644
--- a/reference/ToDo/src/global.json
+++ b/reference/ToDo/src/global.json
@@ -1,7 +1,7 @@
{
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
"msbuild-sdks": {
- "Uno.Sdk": "6.0.67"
+ "Uno.Sdk": "6.0.146"
},
"sdk": {
"allowPrerelease": false
diff --git a/reference/ToDo/toc.yml b/reference/ToDo/toc.yml
new file mode 100644
index 000000000..aa3f2246d
--- /dev/null
+++ b/reference/ToDo/toc.yml
@@ -0,0 +1,17 @@
+- name: To-Do App
+ href: xref:Uno.Workshops.ToDo-App.Overview
+ items:
+ - name: Overview
+ href: xref:Uno.Workshops.ToDo-App.Overview
+ - name: Accessing Tokens with Authentication
+ href: xref:Uno.Workshops.ToDo-App.AccessingAuthTokens
+ - name: Common Navigation
+ href: xref:Uno.Workshops.ToDo-App.Common-Navigation
+ - name: Localize by Model
+ href: xref:Uno.Workshops.ToDo-App.LocalizeByModel
+ - name: Localize with Uid
+ href: xref:Uno.Workshops.ToDo-App.LocalizeWithUid
+ - name: Theme switching with ThemeService
+ href: xref:Uno.Workshops.ToDo-App.Theme-Switching-by-ThemeService
+ - name: Reactive ListFeeds with FeedViews
+ href: xref:Uno.Workshops.ToDo-App.Reactive-ListFeeds-FeedViews
diff --git a/reference/TubePlayer/README.md b/reference/TubePlayer/README.md
index f736b7aa5..15df64f10 100644
--- a/reference/TubePlayer/README.md
+++ b/reference/TubePlayer/README.md
@@ -30,16 +30,16 @@ The TubePlayer app utilizes the latest Uno Platform features, including:
- [C# Markup](https://aka.platform.uno/csharp-markup)
- [Extensions](https://platform.uno/docs/articles/external/uno.extensions/doc/ExtensionsOverview.html)
- - [MVUX](https://aka.platform.uno/mvux)
- - [Configuration](https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Configuration/ConfigurationOverview.html)
- - [Http](https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Http/HttpOverview.html)
+ - [MVUX](https://aka.platform.uno/mvux)
+ - [Configuration](https://aka.platform.uno/docs/articles/external/uno.extensions/doc/Learn/Configuration/ConfigurationOverview.html)
+ - [Http](https://aka.platform.uno/docs/articles/external/uno.extensions/doc/Learn/Http/HttpOverview.html)
- [Figma plugin](https://aka.platform.uno/uno-figma)
-- [Color overrides](https://platform.uno/docs/articles/external/uno.themes/doc/material-getting-started.html#manual-color-overrides)
-- [DSP import](https://platform.uno/docs/articles/external/uno.themes/doc/material-dsp.html)
-- [Material design theme](https://platform.uno/docs/articles/external/uno.themes/doc/material-getting-started.html)
-- [Toolkit](https://platform.uno/docs/articles/external/uno.toolkit.ui/doc/getting-started.html)
-- [Resizetizer](https://platform.uno/docs/articles/external/uno.resizetizer/doc/using-uno-resizetizer.html)
+- [Color overrides](https://aka.platform.uno/docs/articles/external/uno.themes/doc/material-getting-started.html#manual-color-overrides)
+- [DSP import](https://aka.platform.uno/docs/articles/external/uno.themes/doc/material-dsp.html)
+- [Material design theme](https://aka.platform.uno/docs/articles/external/uno.themes/doc/material-getting-started.html)
+- [Toolkit](https://aka.platform.uno/docs/articles/external/uno.toolkit.ui/doc/getting-started.html)
+- [Resizetizer](https://aka.platform.uno/docs/articles/external/uno.resizetizer/doc/using-uno-resizetizer.html)
## Workshop
-For a deeper understanding, you can also explore the [TubePlayer Workshop](https://aka.platform.uno/tubeplayer-workshop), where you'll be guided through the entire app creation process. Each module is accompanied by detailed explanations to ensure a comprehensive learning experience.
\ No newline at end of file
+For a deeper understanding, you can also explore the [TubePlayer Workshop](https://aka.platform.uno/tubeplayer-workshop), where you'll be guided through the entire app creation process. Each module is accompanied by detailed explanations to ensure a comprehensive learning experience.