From ed0d0c4f3b0352b5ce979b8d86d6a6fa136b2c2c Mon Sep 17 00:00:00 2001 From: eriklimakc Date: Fri, 31 May 2024 13:03:22 +0100 Subject: [PATCH] docs: Updating navigation docs to match latest template --- doc/GettingStarted.md | 2 +- .../Authentication/HowTo-Authentication.md | 2 +- .../Advanced/HowTo-AdvancedPageNavigation.md | 16 +++- .../Advanced/HowTo-UseNavigationView.md | 22 +++-- .../Navigation/Advanced/HowTo-UseTabBar.md | 23 +++-- doc/Learn/Navigation/HowTo-DisplayItem.md | 60 ++++++------ .../Navigation/HowTo-DisplayMessageDialog.md | 94 ++++++++++--------- .../Navigation/HowTo-NavigateBetweenPages.md | 34 ++++--- doc/Learn/Navigation/HowTo-NavigateInCode.md | 31 +++--- doc/Learn/Navigation/HowTo-NavigateInXAML.md | 41 ++++---- doc/Learn/Navigation/HowTo-SelectValue.md | 21 +++-- 11 files changed, 198 insertions(+), 148 deletions(-) diff --git a/doc/GettingStarted.md b/doc/GettingStarted.md index dc625ec69d..cb31721ac3 100644 --- a/doc/GettingStarted.md +++ b/doc/GettingStarted.md @@ -23,7 +23,7 @@ This tutorial will walk you through how to create an Uno application with Uno.Ex ![Visual Studio - Configure project name and location](./Learn/images/configure-new-unoplatform-app.png) -* Choose a template preset to build your application +* Choose the **Recommended** preset to build your application ![Visual Studio - Configure your new project](./Learn/images/intro.png) diff --git a/doc/Learn/Authentication/HowTo-Authentication.md b/doc/Learn/Authentication/HowTo-Authentication.md index 8341ee6862..1e25b84181 100644 --- a/doc/Learn/Authentication/HowTo-Authentication.md +++ b/doc/Learn/Authentication/HowTo-Authentication.md @@ -93,7 +93,7 @@ uid: Uno.Extensions.Authentication.HowToAuthentication } ``` -- Update the "Second" route in `App.xaml.host.cs` to specify that it depends on the "Main" route. This will make sure that even if the app navigates directly to the SecondPage, the MainPage will be added to the backstack. +- Update the "Second" route in `App.xaml.cs` to specify that it depends on the "Main" route. This will make sure that even if the app navigates directly to the SecondPage, the MainPage will be added to the back stack. ```csharp routes diff --git a/doc/Learn/Navigation/Advanced/HowTo-AdvancedPageNavigation.md b/doc/Learn/Navigation/Advanced/HowTo-AdvancedPageNavigation.md index 017de782a2..16c48a61fb 100644 --- a/doc/Learn/Navigation/Advanced/HowTo-AdvancedPageNavigation.md +++ b/doc/Learn/Navigation/Advanced/HowTo-AdvancedPageNavigation.md @@ -7,6 +7,14 @@ When using navigation, you may not want to allow the current page to remain in t Using backward/forward navigation in your app requires a degree of extra consideration. Users always expect the back/forward button to take them to a page that is still relevant, yet logically related to the current page and direction. This page contains several concise tutorials about how to implement navigation techniques that address these more advanced problems. +> [!NOTE] +> This guide uses predefined code created by the Uno Template using the `Recommended` preset, however, it uses the `MVVM` approach for the examples instead of `MVUX` defined in the `Recommended` preset. + +## 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. + ## Techniques ### Navigating to a Page and Clearing Back Stack @@ -58,7 +66,7 @@ It is possible to navigate to a page and clear the back stack from code behind u ```csharp public async Task GoToSecondPage() { - await _navigator.NavigateViewModelAsync(this, qualifier: Qualifiers.ClearBackStack); + await _navigator.NavigateViewModelAsync(this, qualifier: Qualifiers.ClearBackStack); } ``` @@ -70,7 +78,7 @@ Another common scenario is to navigate to a page and then remove the current pag #### From XAML -- Add a new `Page` to navigate to, `SamplePage.xaml`, in the UI (shared) project +- Add a new `Page` to navigate to, `SamplePage.xaml` - In `SecondPage.xaml` add a `Button` with the following XAML, which does _not_ include a handler for the Click event @@ -91,8 +99,8 @@ Another common scenario is to navigate to a page and then remove the current pag #### From code behind -- Add a new `Page` to navigate to, `SamplePage.xaml`, in the UI (shared) project -- In `SecondPage.xaml` add a `Button` with the following XAML, which includes a handler for the Click event +- Add a new `Page` to navigate to, `SamplePage.xaml` +- In `SecondPage.xaml` add a `Button` with the following XAML, which includes a handler for the Click event ```xml