Table of Contents

How To: Add Uno Extensions Navigation to an Existing Application

If you already have an existing Uno application, you can of course add Extensions Navigation.

Adding UnoFeatures

In the project file, recognizable by the .csproj extension, you need the following UnoFeatures elements in addition to the Uno.Sdk:

<UnoFeatures>
    Hosting;
    Mvux;
    Navigation;
    Toolkit;
</UnoFeatures>
Tip

The Toolkit feature is only required to use navigation controls like TabBar or DrawerControl.

App.xaml.cs Configuration

Add the following content to your App.xaml.cs file if not already included:

+    protected async override void OnLaunched(LaunchActivatedEventArgs args)
+    {
+        var builder = this.CreateBuilder(args)
+            // Adds support for additional navigation controls like TabBar and NavigationView
+            .UseToolkitNavigation()
+            .Configure(host => host
+                // Add the callback to the RegisterRoutes method, which will define the routes in the application.
+                .UseNavigation(ReactiveViewModelMappings.ViewModelMappings, RegisterRoutes)
+            );
        MainWindow = builder.Window;

#if DEBUG
        MainWindow.UseStudio();
#endif
        MainWindow.SetWindowIcon();

+        Host = await builder.NavigateAsync<Shell>();
    }

Next Steps