OnScreenHeightExtension Class
Implements a XAML extension that allows you to specify control settings depending on the current screen height and screen orientation.
Namespace: DevExpress.Maui.Core
Assembly: DevExpress.Maui.Core.dll
NuGet Package: DevExpress.Maui.Core
Declaration
public class OnScreenHeightExtension :
OnScreenSizeExtensionBase
Remarks
You can use the OnScreenHeightExtension
to adapt the app layout and control settings when changing screen height. For example, the available screen height changes when you rotate the screen to switch orientation from landscape to portrait or vice versa.
The following example shows how to specify the DXButton‘s height depending on the device screen height:
<ContentPage ...
xmlns:dx="clr-namespace:DevExpress.Maui.Core;assembly=DevExpress.Maui.Core">
<!--...-->
<dx:DXButton Content="Click"
HeightRequest="{dx:OnScreenHeight ExtraSmall='50', Small='75', Medium='100', Large='150', ExtraLarge='200'}"/>
<!--...-->
</ContentPage>
The table below describes different size classes and their breakpoints in logical (device-independent) pixels:
Size class | Breakpoints |
---|---|
ExtraSmall | height < 360 |
Small | height ≥ 360 |
Medium | height ≥ 375 |
Large | height ≥ 428 |
ExtraLarge | height ≥ 768 |
The height is calculated as follows: Pixel height / Density.
Refer to the following page for more information: Device display information.
See the following help section for sample devices of each size class: Size Class Classification.
To change the size class breakpoints, use the following properties:
In C# code, you can use the ON.ScreenHeight method to set values depending on the screen height.