Skip to main content
ON

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

OnOrientationExtension Class

Implements a XAML extension that allows you to specify control settings (for example, the font size) depending on the device orientation.

Namespace: DevExpress.Maui.Core

Assembly: DevExpress.Maui.Core.dll

NuGet Package: DevExpress.Maui.Core

#Declaration

C#
public class OnOrientationExtension :
    DynamicMarkupExtensionBase

#Remarks

The following example shows how to select paddings of a DXButton‘s text depending on the device orientation:

<ContentPage ...
             xmlns:dx="clr-namespace:DevExpress.Maui.Core;assembly=DevExpress.Maui.Core">
    <!--...-->
        <dx:DXButton Content="Click" Padding="{dx:OnOrientation Portrait='10,4', Landscape='12,8'}"/>
    <!--...-->
</ContentPage>

In C# code, you can use the ON.Orientation method to set values that depend on the device orientation.

#Implements

IMarkupExtension<System.Object>

#Inheritance

System.Object
DevExpress.Maui.Core.Internal.MarkupExtensionBase<System.Object>
DevExpress.Maui.Core.Internal.DynamicMarkupExtensionBase
OnOrientationExtension
See Also