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

DXDockLayout.StretchLastItem Property

Gets or sets whether the last added item occupies all the remaining space within the layout. This is a bindable property.

Namespace: DevExpress.Maui.Core

Assembly: DevExpress.Maui.Core.dll

NuGet Package: DevExpress.Maui.Core

#Declaration

C#
public bool StretchLastItem { get; set; }

#Property Value

Type Description
Boolean

true if the last added item occupies all available space; otherwise, false.

#Remarks

The following image shows how the StretchLastItem property affects the layout of the last added item (“None”):

DevExpress Layouts for .NET MAUI - DockLayout StretchLastItem property in action

<ContentPage.Resources>
    <Style TargetType="dx:DXBorder">
        <Setter Property="BorderColor" Value="DarkGray"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Margin" Value="2"/>
        <Setter Property="BackgroundColor" Value="#FDF8FD"/>
    </Style>
    <DataTemplate x:Key="contentTemplate">
        <Label Text="{Binding}" Padding="2" FontSize="Medium"/>
    </DataTemplate>
</ContentPage.Resources>

<dx:DXDockLayout StretchLastItem="False">
    <dx:DXBorder dx:DXDockLayout.Dock="Top" Content="Top" ContentTemplate="{StaticResource contentTemplate}" HeightRequest="80"/>
    <dx:DXBorder dx:DXDockLayout.Dock="Left" Content="Left" ContentTemplate="{StaticResource contentTemplate}" WidthRequest="80"/>
    <dx:DXBorder dx:DXDockLayout.Dock="Right" Content="Right" ContentTemplate="{StaticResource contentTemplate}" WidthRequest="80"/>
    <dx:DXBorder dx:DXDockLayout.Dock="Bottom" Content="Bottom" ContentTemplate="{StaticResource contentTemplate}" HeightRequest="80"/>
    <dx:DXBorder Content="None" ContentTemplate="{StaticResource contentTemplate}" />
</dx:DXDockLayout>
See Also