Skip to content

[Windows] Issues with BoxView Placement Inside Border #19668

Open
@kasanhoon

Description

@kasanhoon

Description

In a .NET 8 Windows environment, there is an issue where placing a BoxView inside a Border results in incorrect sizing. When BoxView and Border are placed separately, there are no significant issues. However, when a BoxView is nested within a Border, both the Border and BoxView are rendered at incorrect sizes.

This problem has not been observed in Android and iOS environments. It appears to be an issue exclusive to the Windows .NET 8 platform.

MainPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="BorderTest.MainPage">

    <ScrollView>
        <VerticalStackLayout
            Padding="30,0"
            Spacing="25">
            <Image
                Source="dotnet_bot.png"
                HeightRequest="185"
                Aspect="AspectFit"/>
            <HorizontalStackLayout Spacing="25" HorizontalOptions="Center">
                <!--right size-->
                <Border WidthRequest="55" HeightRequest="35" StrokeThickness="3" >
                    <Border.StrokeShape>
                        <RoundRectangle CornerRadius="6"/>
                    </Border.StrokeShape>
                </Border>
                <Label Text="+" VerticalOptions="Center" />
                <BoxView WidthRequest="55" HeightRequest="35" Color="LightBlue" CornerRadius="6" BackgroundColor="Transparent"/>
                <Label Text="=" VerticalOptions="Center" />
                <!--wrong size-->
                <Border WidthRequest="55" HeightRequest="35" StrokeThickness="3" >
                    <Border.StrokeShape>
                        <RoundRectangle CornerRadius="6"/>
                    </Border.StrokeShape>
                    <BoxView WidthRequest="55" HeightRequest="35" Color="LightBlue" CornerRadius="6" BackgroundColor="Transparent"/>
                </Border>
            </HorizontalStackLayout>
        </VerticalStackLayout>
    </ScrollView>

</ContentPage>

MainPage.xaml.cs

namespace BorderTest
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }
    }
}

Result
borderdesktop2

Steps to Reproduce

  1. Create a default MAUI project.
  2. Replace the MainPage.xaml and MainPage.xaml.cs with the code provided above.
  3. Build & Execute the project on Windows.
  4. Observe the sizes of the Border and BoxView.

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.101

Affected platforms

Windows

Affected platform versions

windows10.0.19041.0

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-borderBorderarea-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterlayout-stackpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/windows 🪟potential-regressionThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions