Skip to content

Commit

Permalink
Merge pull request #2015 from unoplatform/dev/nr/tabbardocs
Browse files Browse the repository at this point in the history
docs: Improving docs for navigation with tabbar and logging
  • Loading branch information
nickrandolph authored Nov 9, 2023
2 parents 5e83d2d + f30628f commit 4dbe123
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
13 changes: 6 additions & 7 deletions doc/Learn/Tutorials/Logging/HowTo-InternalLogging.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ uid: Learn.Tutorials.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.

> [!IMPORTANT]
> This guide assumes your application has already opted into logging. To find out how to do this, refer to the tutorial [here](xref:Learn.Tutorials.Logging.UseLogging)
> [!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 [instructions](xref:Overview.Extensions) for creating an application from the template.
> [!IMPORTANT]
> This guide assumes your application has already opted into logging. To find out how to do this, refer to the tutorial [here](xref:Learn.Tutorials.Logging.UseLogging)
### 1. Enable Uno internal logging

* To log Uno-internal messages, you first need to call `UseLogging()` on the `IHost` instance:
* To log Uno-internal messages, you first need to call `UseLogging()` on the `IHost` instance, passing `true` in for the enableUnoLogging parameter:

```csharp
private IHost Host { get; }
Expand All @@ -25,11 +25,10 @@ uid: Learn.Tutorials.Logging.UseInternalLogging
var appBuilder = this.CreateBuilder(args)
.Configure(host => {
host
.UseLogging()
.UseLogging(enableUnoLogging: true)
});

Host = appBuilder.Build();
...
```

### 2. Set verbosity level of XAML logging
Expand Down
3 changes: 3 additions & 0 deletions doc/Learn/Tutorials/Logging/HowTo-Logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ uid: Learn.Tutorials.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]
Expand Down
9 changes: 9 additions & 0 deletions doc/Learn/Tutorials/Navigation/Advanced/HowTo-UseTabBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ uid: Learn.Tutorials.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`).

```csharp
var builder = this.CreateBuilder(args)
// Add navigation support for toolkit controls such as TabBar and NavigationView
.UseToolkitNavigation()
.Configure(host => host....);
```

## Step-by-steps

### 1. Add necessary XAML namespaces
Expand Down

0 comments on commit 4dbe123

Please sign in to comment.