diff --git a/doc/Learn/Authentication/AuthenticationOverview.md b/doc/Learn/Authentication/AuthenticationOverview.md index 6f3b5915ed..ede11766c3 100644 --- a/doc/Learn/Authentication/AuthenticationOverview.md +++ b/doc/Learn/Authentication/AuthenticationOverview.md @@ -10,6 +10,15 @@ There are two aspects to the Authentication extensions: - Authentication: the process of authenticating the user and acquiring tokens - Authorization: tokens (acquired via authentication) can be queried to control access to parts of the application or supplied to service call so the user can be authorized to access the back-end service +## Installation + +`Authentication` is provided as an Uno Feature. To enable `Authentication` support in your application, add `Authentication` to the `` property in the Class Library (.csproj) file. In case you are using Msal Authentication add `AuthenticationMsal`, or `AuthenticationOidc` for Oidc Authentication. + +> [!IMPORTANT] +> This walkthrough assumes you created your app using the Single Project template. If you used a different template, please refer to our [Migrating Projects to Single Project](xref:Uno.Development.MigratingToSingleProject) documentation. + +For more information about `UnoFeatures` refer to our [Using the Uno.Sdk](xref:Uno.Features.Uno.Sdk) docs. + ## IAuthenticationService The `IAuthenticationService` interface defines the methods that an application can call to authenticate the user. @@ -64,11 +73,11 @@ The `CustomAuthenticationProvider` provides a basic implementation of the `IAuth ### MSAL -The `MsalAuthenticationProvider` (in the Uno.Extensions.Authentication.MSAL.UI or Uno.Extensions.Authentication.MSAL.WinUI packages) wraps the [MSAL library](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet) from Microsoft into an implementation of `IAuthenticationProvider`. This implementation ignores any credentials passed into the `LoginAsync` method, instead invoking the web based authentication process required to authentication with Microsoft. Learn [Msal authentication](xref:Uno.Extensions.Authentication.HowToMsalAuthentication) +The `MsalAuthenticationProvider` wraps the [MSAL library](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet) from Microsoft into an implementation of `IAuthenticationProvider`. This implementation ignores any credentials passed into the `LoginAsync` method, instead invoking the web based authentication process required to authentication with Microsoft. Learn [Msal authentication](xref:Uno.Extensions.Authentication.HowToMsalAuthentication) ### Oidc -The `OidcAuthenticationProvider` (in the Uno.Extensions.Authentication.Oidc.UI or Uno.Extensions.Authentication.Oidc.WinUI packages) wraps support for any [OpenID Connect](https://openid.net/connect/) backend, including [IdentityServer](https://duendesoftware.com/products/identityserver). Learn [Oidc authentication](xref:Uno.Extensions.Authentication.HowToOidcAuthentication) +The `OidcAuthenticationProvider` wraps support for any [OpenID Connect](https://openid.net/connect/) backend, including [IdentityServer](https://duendesoftware.com/products/identityserver). Learn [Oidc authentication](xref:Uno.Extensions.Authentication.HowToOidcAuthentication) #### Platform-specific behavior diff --git a/doc/Learn/Authentication/HowTo-Authentication.md b/doc/Learn/Authentication/HowTo-Authentication.md index 8341ee6862..d7cbee43f3 100644 --- a/doc/Learn/Authentication/HowTo-Authentication.md +++ b/doc/Learn/Authentication/HowTo-Authentication.md @@ -12,7 +12,16 @@ uid: Uno.Extensions.Authentication.HowToAuthentication ### 1. Basic Credential Checking -- Install `Uno.Extensions.Authentication` into all projects +- Add `Authentication` to the `` property in the Class Library (.csproj) file. + + ```diff + + Material; + + Authentication; + Toolkit; + MVUX; + + ``` - Append `UseAuthentication` to the `IHostBuilder` instance. The `Login` callback is used to verify the credentials. If the user is authenticated, the callback needs to return a non-empty dictionary of key-value pairs (this would typically contain tokens such as an access token and/or refresh token). @@ -133,7 +142,17 @@ From this walk through, you can see how the IAuthenticationService can be used t ### 2. Invoking an Authentication Service -- Add `Uno.Extensions.Http.Refit` package reference to Extensions.props +- Add `Http` to the `` property in the Class Library (.csproj) file. This will bring the references we need to access `Refit`. + + ```diff + + Material; + Authentication; + + Http; + Toolkit; + MVUX; + + ``` - Add POCO objects to working with [dummyjson.com](https://dummyjson.com) diff --git a/doc/Learn/Authentication/HowTo-MsalAuthentication.md b/doc/Learn/Authentication/HowTo-MsalAuthentication.md index 5a143a0cc0..a3ce9f0888 100644 --- a/doc/Learn/Authentication/HowTo-MsalAuthentication.md +++ b/doc/Learn/Authentication/HowTo-MsalAuthentication.md @@ -16,7 +16,16 @@ uid: Uno.Extensions.Authentication.HowToMsalAuthentication - The identity provider will provider you with a client ID and guidance on scopes to use. -- Make sure `Uno.Extensions.Authentication.MSAL.WinUI` NuGet package is installed in your solution. +- Add `AuthenticationMsal` to the `` property in the Class Library (.csproj) file. + + ```diff + + Material; + + AuthenticationMsal; + Toolkit; + MVUX; + + ``` ### 2. Set up MSAL authentication diff --git a/doc/Learn/Authentication/HowTo-OidcAuthentication.md b/doc/Learn/Authentication/HowTo-OidcAuthentication.md index c7bbe3e019..61e7f2d3dc 100644 --- a/doc/Learn/Authentication/HowTo-OidcAuthentication.md +++ b/doc/Learn/Authentication/HowTo-OidcAuthentication.md @@ -16,7 +16,16 @@ uid: Uno.Extensions.Authentication.HowToOidcAuthentication - A client id (and client secret) will be provided to you. -- Make sure `Uno.Extensions.Authentication.Oidc.WinUI` NuGet package is installed in your solution. +- Add `AuthenticationOidc` to the `` property in the Class Library (.csproj) file. + + ```diff + + Material; + + AuthenticationOidc; + Toolkit; + MVUX; + + ``` ### 2. Set up OIDC authentication diff --git a/doc/Learn/Authentication/HowTo-WebAuthentication.md b/doc/Learn/Authentication/HowTo-WebAuthentication.md index 4ccaa589fe..d0befe8a37 100644 --- a/doc/Learn/Authentication/HowTo-WebAuthentication.md +++ b/doc/Learn/Authentication/HowTo-WebAuthentication.md @@ -16,7 +16,16 @@ uid: Uno.Extensions.Authentication.HowToWebAuthentication - A client id (and client secret) will be provided to you. -- Make sure `Uno.Extensions.Authentication.WinUI` NuGet package is installed in your solution. +- Add `Authentication` to the `` property in the Class Library (.csproj) file. + + ```diff + + Material; + + Authentication; + Toolkit; + MVUX; + + ``` ### 2. Set up web authentication @@ -72,10 +81,10 @@ uid: Uno.Extensions.Authentication.HowToWebAuthentication ```json { - "Web": { - "LoginStartUri": "URI_TO_LOGIN", - "LogoutStartUri": "URI_TO_LOGOUT" - } + "Web": { + "LoginStartUri": "URI_TO_LOGIN", + "LogoutStartUri": "URI_TO_LOGOUT" + } } ``` diff --git a/doc/Learn/Configuration/ConfigurationOverview.md b/doc/Learn/Configuration/ConfigurationOverview.md index ff0e2dbb41..af2e3e06a9 100644 --- a/doc/Learn/Configuration/ConfigurationOverview.md +++ b/doc/Learn/Configuration/ConfigurationOverview.md @@ -7,6 +7,18 @@ uid: Uno.Extensions.Configuration.Overview This feature uses [Microsoft.Extensions.Configuration](https://www.nuget.org/packages/Microsoft.Extensions.Configuration) for any configuration related work. For more documentation on configuration, read the references listed at the bottom. +## Installation + +> [!NOTE] +> If you already have `Extensions` in ``, then `Configuration` is already installed, as its dependencies are included with the `Extensions` feature. + +`Configuration` is provided as an Uno Feature. To enable `Configuration` support in your application, add `Configuration` to the `` property in the Class Library (.csproj) file. + +> [!IMPORTANT] +> This walkthrough assumes you created your app using the Single Project template. If you used a different template, please refer to our [Migrating Projects to Single Project](xref:Uno.Development.MigratingToSingleProject) documentation. + +For more information about `UnoFeatures` refer to our [Using the Uno.Sdk](xref:Uno.Features.Uno.Sdk) docs. + ## Using Configuration The `IConfiguration` interface is registered as a service when the `UseConfiguration()` extension method is used. diff --git a/doc/Learn/Configuration/HowTo-Configuration.md b/doc/Learn/Configuration/HowTo-Configuration.md index 5b1be8320b..be31364136 100644 --- a/doc/Learn/Configuration/HowTo-Configuration.md +++ b/doc/Learn/Configuration/HowTo-Configuration.md @@ -10,7 +10,20 @@ uid: Uno.Extensions.Configuration.HowToConfiguration > [!IMPORTANT] > This guide assumes you used the template wizard or `dotnet new unoapp` to create your solution. If not, it is recommended that you follow the [Creating an application with Uno.Extensions article](xref:Uno.Extensions.HowToGettingStarted) for creating an application from the template. -### 1. Specify configuration information to load on `IConfigBuilder` +### 1. Installation + +* Add `Configuration` to the `` property in the Class Library (.csproj) file. If you already have `Extensions` in ``, then `Configuration` is already installed, as its dependencies are included with the `Extensions` feature. + + ```diff + + Material; + + Configuration; + Toolkit; + MVUX; + + ``` + +### 2. Specify configuration information to load on `IConfigBuilder` * Uno.Extensions apps specify which configuration information to load by calling the `UseConfiguration()` extension method for `IHostBuilder`. @@ -50,7 +63,7 @@ uid: Uno.Extensions.Configuration.HowToConfiguration } ``` -### 2. Define a class to model the configuration section +### 3. Define a class to model the configuration section * Your JSON file(s) will consist of a serialized representation of multiple properties and their values. Hence, configuration sections allow you to programmatically read a specific subset of these properties from the instantiated class that represents them. @@ -66,7 +79,7 @@ uid: Uno.Extensions.Configuration.HowToConfiguration } ``` -### 3. Load a specific configuration section +### 4. Load a specific configuration section * You can now use the `Section()` extension method on `IConfigBuilder` to load configuration information for class or record of the type argument you specify: @@ -89,7 +102,7 @@ uid: Uno.Extensions.Configuration.HowToConfiguration } ``` -### 4. Read configuration section values from a registered service +### 5. Read configuration section values from a registered service * To access the instantiated representation of the configuration section you registered above, complete with values populated from the `appsettings.json` file, you'll need to add a new constructor parameter for it to one of your application's services. diff --git a/doc/Learn/Configuration/HowTo-WritableConfiguration.md b/doc/Learn/Configuration/HowTo-WritableConfiguration.md index 5ee2cabb5c..523780af72 100644 --- a/doc/Learn/Configuration/HowTo-WritableConfiguration.md +++ b/doc/Learn/Configuration/HowTo-WritableConfiguration.md @@ -15,7 +15,16 @@ A special interface called `IWritableOptions` is registered as a service when ### 1. Prepare for writing configuration values -* Ensure your project has `Uno.Extensions.Configuration` installed as a NuGet [package](https://www.nuget.org/packages/Uno.Extensions.Configuration/). +* Add `Configuration` to the `` property in the Class Library (.csproj) file. If you already have `Configuration` in ``, then `Configuration` is already installed, as its dependencies are included with the `Extensions` feature. + + ```diff + + Material; + + Configuration; + Toolkit; + MVUX; + + ``` * To enable configuration, you first need to call `UseConfiguration()` on the `IHostBuilder` instance: diff --git a/doc/Learn/DependencyInjection/HowTo-CommunityToolkit.md b/doc/Learn/DependencyInjection/HowTo-CommunityToolkit.md index 74104b9eb9..7cfef0216e 100644 --- a/doc/Learn/DependencyInjection/HowTo-CommunityToolkit.md +++ b/doc/Learn/DependencyInjection/HowTo-CommunityToolkit.md @@ -16,9 +16,18 @@ This tutorial will walk you through how to set up this feature and use it to man > [!IMPORTANT] > This guide assumes you used the template wizard or `dotnet new unoapp` to create your solution. If not, it is recommended that you follow the [Creating an application with Uno.Extensions article](xref:Uno.Extensions.HowToGettingStarted) for creating an application from the template. -### 1. Add the CommunityToolkit.Mvvm package to your project +### 1. Add CommunityToolkit.Mvvm to your project -* Add the [CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm) package to your project. +* Add `Mvvm` to the `` property in the Class Library (.csproj) file. This will add the [CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm) package to your project. + + ```diff + + Material; + Extensions; + + Mvvm; + Toolkit; + + ``` ### 2. Register services with the DI container diff --git a/doc/Learn/Http/HowTo-EndpointOptions.md b/doc/Learn/Http/HowTo-EndpointOptions.md index 381841d487..07e10c3870 100644 --- a/doc/Learn/Http/HowTo-EndpointOptions.md +++ b/doc/Learn/Http/HowTo-EndpointOptions.md @@ -38,6 +38,18 @@ It's often necessary to include an API key alongside requests to a web API. This ### 2. Defining the endpoint +* Add `Http` to the `` property in the Class Library (.csproj) file. + + ```diff + + Material; + Extensions; + + Http; + Toolkit; + MVUX; + + ``` + * Enable HTTP by calling the `UseHttp()` method to register a HTTP client with the `IHostBuilder`: ```csharp diff --git a/doc/Learn/Http/HowTo-Http.md b/doc/Learn/Http/HowTo-Http.md index 4461c146dd..a443a23b02 100644 --- a/doc/Learn/Http/HowTo-Http.md +++ b/doc/Learn/Http/HowTo-Http.md @@ -10,7 +10,21 @@ When working with a complex application, centralized registration of your API en > [!IMPORTANT] > This guide assumes you used the template wizard or `dotnet new unoapp` to create your solution. If not, it is recommended that you follow the [Creating an application with Uno.Extensions article](xref:Uno.Extensions.HowToGettingStarted) for creating an application from the template. -### 1. Enable HTTP +### 1. Installation + +* Add `Http` to the `` property in the Class Library (.csproj) file. + + ```diff + + Material; + Extensions; + + Http; + Toolkit; + MVUX; + + ``` + +### 2. Enable HTTP * Call the `UseHttp()` method to register a HTTP client with the `IHostBuilder` which implements `IHttpClient`: @@ -26,7 +40,7 @@ When working with a complex application, centralized registration of your API en } ``` -### 2. Register Endpoints +### 3. Register Endpoints * The `AddClient` extension method is used to register a client with the service collection. @@ -66,7 +80,7 @@ When working with a complex application, centralized registration of your API en } ``` -### 3. Use the Service to Request Data +### 4. Use the Service to Request Data * Since you registered the service with the service collection, you can now inject the `IShowService` implementation into your view models and use it to request information about a show from the endpoint: diff --git a/doc/Learn/Http/HowTo-Refit.md b/doc/Learn/Http/HowTo-Refit.md index e47384be20..97e8814922 100644 --- a/doc/Learn/Http/HowTo-Refit.md +++ b/doc/Learn/Http/HowTo-Refit.md @@ -10,7 +10,21 @@ When accessing resources with a [REST-style](https://www.ics.uci.edu/~fielding/p > [!IMPORTANT] > This guide assumes you used the template wizard or `dotnet new unoapp` to create your solution. If not, it is recommended that you follow the [Creating an application with Uno.Extensions article](xref:Uno.Extensions.HowToGettingStarted) for creating an application from the template. -### 1. Enable HTTP +### 1. Installation + +* Add `Http` to the `` property in the Class Library (.csproj) file. + + ```diff + + Material; + Extensions; + + Http; + Toolkit; + MVUX; + + ``` + +### 2. Enable HTTP * When working with a complex application, centralized registration of your API endpoints is a good practice. This allows you to easily change the endpoint for a given service. It also reduces the complexity to adding new services which can then have their `HttpClient` instance reused across multiple instances of view models or other services. @@ -30,7 +44,7 @@ When accessing resources with a [REST-style](https://www.ics.uci.edu/~fielding/p * This feature requires the [Uno.Extensions.Http.WinUI](https://www.nuget.org/packages/Uno.Extensions.Http.WinUI) package. It uses [Microsoft Extensions](https://www.nuget.org/packages/Microsoft.Extensions.Http) for any HTTP-related [work](https://learn.microsoft.com/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#benefits-of-using-ihttpclientfactory) such as naming or configuring the `HttpClient` instance associated with your endpoints. -### 2. Define the live interface +### 3. Define the live interface * For the purposes of this tutorial, we will create and register an interface for the Chuck Norris facts web API which is documented [here](https://api.chucknorris.io/) @@ -54,7 +68,7 @@ When accessing resources with a [REST-style](https://www.ics.uci.edu/~fielding/p * `ApiResponse` is used to deserialize the response from the API. It is defined in the `Refit` package. -### 3. Generate a data model from the API response +### 4. Generate a data model from the API response * The next step is to generate a data model from the response we will get from the API. This will be used to deserialize the response which we'll learn is a JSON object with a `total` property and `result` that contains an array of Chuck Norris data objects. @@ -153,7 +167,7 @@ When accessing resources with a [REST-style](https://www.ics.uci.edu/~fielding/p * Rename the partial classes `Welcome` to `ChuckNorrisData` and `Result` to `ChuckNorrisDataResult` -### 4. Register the endpoint +### 5. Register the endpoint * Unlike standard HTTP endpoints, Refit endpoints you define will be registered as a service with the `AddRefitClient()` extension method, where the type argument `T` corresponds to an interface you define. @@ -217,7 +231,7 @@ When accessing resources with a [REST-style](https://www.ics.uci.edu/~fielding/p * Observe that the name of the configuration section is similar to that of the endpoint interface we defined earlier. By default, the interface name without the leading `I` prefix is assumed to be the section name. This can be overridden by specifying a name while registering the service. The name you use should be the second argument to `AddRefitClient()`. -### 5. Use the endpoint +### 6. Use the endpoint * `IChuckNorrisEndpoint` can now be used in a service implementation by injecting it into the constructor. This interface will be used to make requests to the web service and deserialize responses. diff --git a/doc/Learn/Http/HttpOverview.md b/doc/Learn/Http/HttpOverview.md index 39de9152f3..f5513a48f4 100644 --- a/doc/Learn/Http/HttpOverview.md +++ b/doc/Learn/Http/HttpOverview.md @@ -7,6 +7,15 @@ Uno.Extensions.Http allows for the registration of API **endpoints** as multiple For additional documentation on HTTP requests, read the references listed at the bottom. +## Installation + +`Http` is provided as an Uno Feature. To enable `Http` support in your application, add `Http` to the `` property in the Class Library (.csproj) file. + +> [!IMPORTANT] +> This walkthrough assumes you created your app using the Single Project template. If you used a different template, please refer to our [Migrating Projects to Single Project](xref:Uno.Development.MigratingToSingleProject) documentation. + +For more information about `UnoFeatures` refer to our [Using the Uno.Sdk](xref:Uno.Features.Uno.Sdk) docs. + ## Register Endpoints Web resources exposed through an API are defined in the application as clients. These client registrations include type arguments and endpoints to be used for the client. The endpoint is defined in the `EndpointOptions` class. While it uses the platform-native HTTP handler by default, this value can be configured. diff --git a/doc/Learn/Localization/HowTo-Localization.md b/doc/Learn/Localization/HowTo-Localization.md index 7a286c0944..44b4b94ebd 100644 --- a/doc/Learn/Localization/HowTo-Localization.md +++ b/doc/Learn/Localization/HowTo-Localization.md @@ -10,7 +10,21 @@ uid: Uno.Extensions.Localization.HowToUseLocalization > [!IMPORTANT] > This guide assumes you used the template wizard or `dotnet new unoapp` to create your solution. If not, it is recommended that you follow the [Creating an application with Uno.Extensions article](xref:Uno.Extensions.HowToGettingStarted) for creating an application from the template. -### 1. Opt into localization +### 1. Installation + +* Add `Localization` to the `` property in the Class Library (.csproj) file. + + ```diff + + Material; + Extensions; + + Localization; + Toolkit; + MVUX; + + ``` + +### 2. Opt into localization * Organize your application's localized `resw` resources into folders corresponding to a language tag @@ -28,7 +42,7 @@ uid: Uno.Extensions.Localization.HowToUseLocalization } ``` -### 2. Use the localization service to resolve localized text +### 3. Use the localization service to resolve localized text * Add a constructor parameter of `IStringLocalizer` type to a view model you registered with the service collection: @@ -55,7 +69,7 @@ uid: Uno.Extensions.Localization.HowToUseLocalization var isResourceNotFound = myString.ResourceNotFound; ``` -### 3. Update the UI culture with `LocalizationSettings` +### 4. Update the UI culture with `LocalizationSettings` * Add a constructor parameter of `ILocalizationService` type to a view model you registered with the service collection: diff --git a/doc/Learn/Localization/LocalizationOverview.md b/doc/Learn/Localization/LocalizationOverview.md index 2dc74460c2..3d22b51d3a 100644 --- a/doc/Learn/Localization/LocalizationOverview.md +++ b/doc/Learn/Localization/LocalizationOverview.md @@ -10,6 +10,15 @@ Many apps store these pieces of text in dedicated resource files that the app pa It uses [Microsoft.Extensions.Localization](https://www.nuget.org/packages/Microsoft.Extensions.Localization) for any localization-related work. For documentation on the broader process of localization, read the references listed at the bottom. +## Installation + +`Localization` is provided as an Uno Feature. To enable `Localization` support in your application, add `Localization` to the `` property in the Class Library (.csproj) file. + +> [!IMPORTANT] +> This walkthrough assumes you created your app using the Single Project template. If you used a different template, please refer to our [Migrating Projects to Single Project](xref:Uno.Development.MigratingToSingleProject) documentation. + +For more information about `UnoFeatures` refer to our [Using the Uno.Sdk](xref:Uno.Features.Uno.Sdk) docs. + ## Set up localization ```csharp diff --git a/doc/Learn/Logging/HowTo-InternalLogging.md b/doc/Learn/Logging/HowTo-InternalLogging.md index a3f8b99bd8..c3aec6a2a7 100644 --- a/doc/Learn/Logging/HowTo-InternalLogging.md +++ b/doc/Learn/Logging/HowTo-InternalLogging.md @@ -5,9 +5,6 @@ uid: Uno.Extensions.Logging.UseInternalLogging `Uno.Extensions.Logging` provides logging capabilities tailored to your target platform. It allows the recording of events for XAML layout, Uno-internal messages, and custom events with severity and verbosity levels of your choice. -> [!NOTE] -> When adding logging support to an application, add the [Uno.Extensions.Logging.WinUI](https://www.nuget.org/packages/Uno.Extensions.Logging.WinUI) NuGet package (instead of `Uno.Extensions.Logging`) which includes platform specific loggers. - ## Step-by-steps > [!IMPORTANT] @@ -15,6 +12,17 @@ uid: Uno.Extensions.Logging.UseInternalLogging ### 1. Enable Uno internal logging +* Add `Logging` to the `` property in the Class Library (.csproj) file. If you already have `Extensions` in ``, then `Logging` is already installed, as its dependencies are included with the `Extensions` feature. + + ```diff + + Material; + + Logging; + Toolkit; + MVUX; + + ``` + * To log Uno-internal messages, you first need to call `UseLogging()` on the `IHost` instance, passing `true` in for the enableUnoLogging parameter: ```csharp diff --git a/doc/Learn/Logging/HowTo-Logging.md b/doc/Learn/Logging/HowTo-Logging.md index eba3ebcff5..628f1d149d 100644 --- a/doc/Learn/Logging/HowTo-Logging.md +++ b/doc/Learn/Logging/HowTo-Logging.md @@ -5,15 +5,25 @@ uid: Uno.Extensions.Logging.UseLogging `Uno.Extensions.Logging` allows you to leverage logging capabilities tailored to your target platform to easily record events for XAML layout, Uno-internal messages, and custom events with severity and verbosity levels of your choice. -> [!NOTE] -> When adding logging support to an application, add the [Uno.Extensions.Logging.WinUI](https://www.nuget.org/packages/Uno.Extensions.Logging.WinUI) NuGet package (instead of `Uno.Extensions.Logging`) which includes platform specific loggers. - ## Step-by-steps > [!IMPORTANT] > This guide assumes you used the template wizard or `dotnet new unoapp` to create your solution. If not, it is recommended that you follow the [Creating an application with Uno.Extensions article](xref:Uno.Extensions.HowToGettingStarted) for creating an application from the template. -### 1. Opt into logging +### 1. Installation + +* Add `Logging` to the `` property in the Class Library (.csproj) file. If you already have `Extensions` in ``, then `Logging` is already installed, as its dependencies are included with the `Extensions` feature. + + ```diff + + Material; + + Logging; + Toolkit; + MVUX; + + ``` + +### 2. Opt into logging * Uno.Extensions offers a simple way to wire up platform-specific log providers such as `Uno.Extensions.Logging.OSLogLoggerProvider` for iOS and `Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider` for WASM as both debug and console logging. @@ -29,7 +39,7 @@ uid: Uno.Extensions.Logging.UseLogging ... ``` -### 2. Use the injected service to log application events +### 3. Use the injected service to log application events * Add a constructor parameter of `ILogger` type to a view model you registered with the service collection: diff --git a/doc/Learn/Logging/LoggingOverview.md b/doc/Learn/Logging/LoggingOverview.md index a6d9d62517..09ed2b9977 100644 --- a/doc/Learn/Logging/LoggingOverview.md +++ b/doc/Learn/Logging/LoggingOverview.md @@ -8,6 +8,18 @@ Apps that record events typically do so for informational or diagnostic purposes It uses [Microsoft.Extensions.Logging](https://www.nuget.org/packages/Microsoft.Extensions.Logging) for logging abstractions. For more documentation about logging, read the references listed at the bottom. +## Installation + +> [!NOTE] +> If you already have `Extensions` in ``, then `Logging` is already installed, as its dependencies are included with the `Extensions` feature. + +`Logging` is provided as an Uno Feature. To enable `Logging` support in your application, add `Logging` to the `` property in the Class Library (.csproj) file. + +> [!IMPORTANT] +> This walkthrough assumes you created your app using the Single Project template. If you used a different template, please refer to our [Migrating Projects to Single Project](xref:Uno.Development.MigratingToSingleProject) documentation. + +For more information about `UnoFeatures` refer to our [Using the Uno.Sdk](xref:Uno.Features.Uno.Sdk) docs. + ## Platform Log Providers To wire-up the platform-specific log providers for debug and console logging, use the extension method `UseLogging()` on the `IHostBuilder` instance: diff --git a/doc/Learn/Markup/GeneratingExtensions.md b/doc/Learn/Markup/GeneratingExtensions.md index d0aade48b7..9da80bcade 100644 --- a/doc/Learn/Markup/GeneratingExtensions.md +++ b/doc/Learn/Markup/GeneratingExtensions.md @@ -16,9 +16,6 @@ The Uno Platform team is shipping a number of pre-generated extension libraries - [Uno.Extensions.Reactive.WinUI.Markup](https://www.nuget.org/packages/Uno.Extensions.Reactive.WinUI.Markup) - [Uno.Themes.WinUI.Markup](https://www.nuget.org/packages/Uno.Themes.WinUI.Markup) -> [!TIP] -> For more information on generating extensions on your own libraries see [Generating Extensions](xref:Uno.Extensions.Markup.GeneratingExtensions). - ## Using the Generator for 3rd Party Libraries To generate extensions for another assembly (i.e. from a NuGet dependency) you can add the `GenerateMarkupForAssembly` attribute to the assembly with a specified reference type from the assembly to scan. @@ -32,9 +29,3 @@ using Microsoft.UI.Xaml.Generator; > [!TIP] > If you do not add the reference to the Generator NuGet this attribute will be ignored and no source will be generated. - -## Next Steps - -Learn more about: - -- [Generating C# Extensions for your libraries](xref:Uno.Extensions.Markup.GeneratingExtensions) diff --git a/doc/Learn/Mvux/Tutorials/HowTo-MvuxProject.md b/doc/Learn/Mvux/Tutorials/HowTo-MvuxProject.md index 9372ff033d..5f74fef6b8 100644 --- a/doc/Learn/Mvux/Tutorials/HowTo-MvuxProject.md +++ b/doc/Learn/Mvux/Tutorials/HowTo-MvuxProject.md @@ -9,6 +9,8 @@ In this tutorial, you'll learn how to set up an Uno Platform project to use MVUX > [!NOTE] > Make sure to setup your environment first by [following our instructions](xref:Uno.GetStarted.vs2022). +## Creating a new Uno app with MVUX + 1. Make sure your environment is set up properly by using [uno check](xref:UnoCheck.UsingUnoCheck). 1. You can create an Uno Platform App by either using the Uno Platform Visual Studio extension or via the command line interface. @@ -48,3 +50,21 @@ In this tutorial, you'll learn how to set up an Uno Platform project to use MVUX on using the CLI interface of creating projects. - Launch the created solution, MyApp.sln, in Visual Studio or Visual Studio Code. + +## Add MVUX to an existing Uno app + +> [!IMPORTANT] +> This guide assumes you created your app using the Single Project template. If you used a different template, please refer to our [Migrating Projects to Single Project](xref:Uno.Development.MigratingToSingleProject) documentation. + +`MVUX` is provided as an Uno Feature. To enable `MVUX` support in your application, add `MVUX` to the `` property in the Class Library (.csproj) file. + +```diff + + Material; + Extensions; ++ MVUX; + Toolkit; + +``` + +For more information about `UnoFeatures` refer to our [Using the Uno.Sdk](xref:Uno.Features.Uno.Sdk) docs. diff --git a/doc/Learn/Navigation/Advanced/HowTo-UseTabBar.md b/doc/Learn/Navigation/Advanced/HowTo-UseTabBar.md index 0fc102d08b..ffc082b58a 100644 --- a/doc/Learn/Navigation/Advanced/HowTo-UseTabBar.md +++ b/doc/Learn/Navigation/Advanced/HowTo-UseTabBar.md @@ -5,7 +5,7 @@ uid: Uno.Extensions.Navigation.Advanced.TabBar The navigation capabilities offered by Uno.Extensions include regions. Regions allow you to associate a specific sector of the view with an individual item on a navigation control from the same `Page`. Likewise, the Uno.Extensions library has built-in support for responding to navigation gestures from the [Toolkit](https://github.com/unoplatform/uno.toolkit.ui) `TabBar`. Follow the steps below to define a user interface centered around navigating with this control. -Since `TabBar` comes from the `Uno.Toolkit` you need to make sure your project has a reference to [Uno.Extensions.Navigation.Toolkit.WinUI](https://www.nuget.org/packages/Uno.Extensions.Navigation.Toolkit.WinUI) nuget package and that you call the `UseToolkitNavigation` extension method on the `IApplicationBuilder` (not `IHostBuilder`). +Since `TabBar` comes from the `Uno.Toolkit` you need to make sure your project has `Toolkit` added to the `` property in the Class Library (.csproj) file and that you call the `UseToolkitNavigation` extension method on the `IApplicationBuilder` (not `IHostBuilder`). For more information about `UnoFeatures` refer to our [Using the Uno.Sdk](xref:Uno.Features.Uno.Sdk) docs. ```csharp var builder = this.CreateBuilder(args) diff --git a/doc/Learn/Navigation/HowTo-NavigateBetweenPages.md b/doc/Learn/Navigation/HowTo-NavigateBetweenPages.md index e7601b7d40..fd44b1d1a8 100644 --- a/doc/Learn/Navigation/HowTo-NavigateBetweenPages.md +++ b/doc/Learn/Navigation/HowTo-NavigateBetweenPages.md @@ -10,17 +10,31 @@ This topic covers using Navigation to navigate between two pages using frame-bas > [!IMPORTANT] > This guide assumes you used the template wizard or `dotnet new unoapp` to create your solution. If not, it is recommended that you follow the [Creating an application with Uno.Extensions article](xref:Uno.Extensions.HowToGettingStarted) for creating an application from the template. -### 1. Navigating to a New Page +### 1. Installation + +* Add `Navigation` to the `` property in the Class Library (.csproj) file. + + ```diff + + Material; + Extensions; + + Navigation; + Toolkit; + MVUX; + + ``` + +### 2. Navigating to a New Page -- Add a new `Page` to navigate to, `SamplePage.xaml`, in the UI (shared) project -- In `MainPage.xaml` replace the existing `Button` with the following XAML, which includes a handler for the Click event +* Add a new `Page` to navigate to, `SamplePage.xaml`, in the UI (shared) project +* In `MainPage.xaml` replace the existing `Button` with the following XAML, which includes a handler for the Click event ```xml