PJSouzaSoftware.NavigationTrans.Maui 0.1.0

dotnet add package PJSouzaSoftware.NavigationTrans.Maui --version 0.1.0
                    
NuGet\Install-Package PJSouzaSoftware.NavigationTrans.Maui -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PJSouzaSoftware.NavigationTrans.Maui" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PJSouzaSoftware.NavigationTrans.Maui" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="PJSouzaSoftware.NavigationTrans.Maui" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PJSouzaSoftware.NavigationTrans.Maui --version 0.1.0
                    
#r "nuget: PJSouzaSoftware.NavigationTrans.Maui, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PJSouzaSoftware.NavigationTrans.Maui@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PJSouzaSoftware.NavigationTrans.Maui&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=PJSouzaSoftware.NavigationTrans.Maui&version=0.1.0
                    
Install as a Cake Tool

PJ.NavigationTrans.Maui 🏳️‍⚧️

This is a library that allows you to use custom animations during Flyout navigations and Push navigations using Shell or NavigationPage. Be aware that transition respects the behavior of the native platform, so they may look different between OSes.

  • Available on NuGet: NuGet

Basic Usage

You can add transitions to your Shell content using XAML:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:PJ.NavigationTrans.Maui;assembly=PJ.NavigationTrans.Maui"
             x:Class="YourNamespace.YourPage"
             local:NavigationTrans.TransitionIn="FadeIn"
             local:NavigationTrans.TransitionOut="FadeOut"
             local:NavigationTrans.Duration="800">
    
</ContentPage>

Adding Transitions in C#

public partial class YourPage : ContentPage
{
    public YourPage()
    {
        InitializeComponent();
        
        // Set transition properties
        NavigationTrans.SetTransitionIn(this, TransitionType.RightIn);
        NavigationTrans.SetTransitionOut(this, TransitionType.LeftOut);
        NavigationTrans.SetDuration(this, 500);
    }
}

Available Built-in Transitions • Default: System default transition • FadeIn/FadeOut: Fade animation • LeftIn/LeftOut: Slide from/to left • RightIn/RightOut: Slide from/to right • TopIn/TopOut: Slide from/to top • BottomIn/BottomOut: Slide from/to bottom • Custom: User-defined custom animation

Custom Animation

Custom Android Animations To create custom Android animations, you need to define animation resources and reference them:

public partial class YourPage : ContentPage
{
    public YourPage()
    {
        InitializeComponent();
        
        // Use custom Android animations by resource ID
        NavigationTrans.SetAndroidTransitions(
            this,
            Resource.Animation.your_enter_animation, // Resource ID for enter animation
            Resource.Animation.your_exit_animation,  // Resource ID for exit animation
            300 // Duration in milliseconds
        );
    }
}

Custom iOS Animations For iOS, you can define custom UIView animations:

public partial class YourPage : ContentPage
{
    public YourPage()
    {
        InitializeComponent();
        
#if IOS
        // Define custom iOS animations
        NavigationTrans.SetIosTransitions(
            this,
            // Animation when entering
            animationIn: view => {
                view.Alpha = 1;
                view.Transform = CGAffineTransform.MakeIdentity();
            },
            // Initial configuration when entering
            configurationOn: view => {
                view.Alpha = 0;
                view.Transform = CGAffineTransform.MakeScale(0.8f, 0.8f);
            },
            // Animation when exiting
            animationOut: view => {
                view.Alpha = 0;
                view.Transform = CGAffineTransform.MakeScale(1.2f, 1.2f);
            },
            // Initial configuration when exiting
            configurationOut: null,
            duration: 400 // Duration in milliseconds
        );
#endif
    }
}

Support

This project is open source and maintained by one person, so if you need a urgent fix for a bug and don't want to submit it you can pay for my work using github sponsor.

Demo

https://github.com/user-attachments/assets/397324c4-c064-4e49-8fc8-574a42b9f3da

Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net10.0-android was computed.  net10.0-ios was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0-android35.0

    • No dependencies.
  • net9.0-ios18.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 143 5/30/2025
0.0.1 149 5/29/2025