Description
There are no compiler errors when a Border has multiple children. All that happens is that the last child is rendered in the Border. There is, however, an intellisense error: XLS0501: The property Content is set more than once.
Behold my Borders:
<!-- Single child -->
<VerticalStackLayout Margin="0,40,0,0">
<Border Stroke="#C49B33"
StrokeThickness="4"
Background="#2B0B98"
Padding="16,8"
HorizontalOptions="Center">
<Border.StrokeShape>
<RoundRectangle CornerRadius="40,0,0,40" />
</Border.StrokeShape>
<Label Text=".NET MAUI"
TextColor="White"
FontSize="18"
FontAttributes="Bold" />
</Border>
<!-- Multiple children -->
<Border Margin="0,50,0,0"
Stroke="#C49B33"
StrokeThickness="4"
Background="#2B0B98"
Padding="16,8"
HorizontalOptions="Center">
<Border.StrokeShape>
<RoundRectangle CornerRadius="40,0,0,40" />
</Border.StrokeShape>
<Label Text=".NET MAUI"
TextColor="White"
FontSize="18"
FontAttributes="Bold" />
<Label Text="Another label"
TextColor="White"
FontSize="18"
FontAttributes="Bold" />
</Border>
</VerticalStackLayout>
I'd expect, to maintain symmetry with the WPF/UWP Border that it shouldn't accept multiple children, and that the way to embed multiple children in it is to do so in a layout.
I get that this could be considered by design (the Content property gets set twice, and it's the final set that wins) but at the very least I'd consider this a paper cut.
Steps to Reproduce
- Run the attached sample.
- Behold the majesty of the borders (all credit to @davidortinau - I don't have a design bone in my body).
Expected Behavior
A compiler error due to the second Border object containing multiple children.
Actual Behavior
No compiler errors. The final child in the Border is the one that's displayed.
Basic Information
- Version with issue: MAUI P9
- IDE: VS 2022 P6
- Platform Target Frameworks:
Screenshots

Reproduction Link
BordersDemo.zip
Workaround
Embed multiple children in a layout.
Description
There are no compiler errors when a
Borderhas multiple children. All that happens is that the last child is rendered in theBorder. There is, however, an intellisense error: XLS0501: The propertyContentis set more than once.Behold my
Borders:I'd expect, to maintain symmetry with the WPF/UWP
Borderthat it shouldn't accept multiple children, and that the way to embed multiple children in it is to do so in a layout.I get that this could be considered by design (the
Contentproperty gets set twice, and it's the final set that wins) but at the very least I'd consider this a paper cut.Steps to Reproduce
Expected Behavior
A compiler error due to the second
Borderobject containing multiple children.Actual Behavior
No compiler errors. The final child in the
Borderis the one that's displayed.Basic Information
Screenshots
Reproduction Link
BordersDemo.zip
Workaround
Embed multiple children in a layout.