Screen orientation - .NET MAUI

In MAUI, there is a simple way to listen for screen orientation changes by subscribing to the DeviceDisplay.Current.MainDisplayInfoChanged handler.

DeviceDisplay.Current.MainDisplayInfoChanged += (sender, displayChanges) =>
{
    var newOrientation = displayChanges.DisplayInfo.Orientation;

    //Apply any logic
};