A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
Hello @Jai Holloway ,
Thanks for your question.
- In your project, both columns are likely defined as
Width="Auto". This means both the label and value shrink to their text size and sit right next to each other with no separation. In .NET 10, the layout engine became stricter and no longer gives extra space automatically like .NET 8 did.
I recommend changing your column definitions:
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TourGrosses.Controls.TourGrossDetailItem">
<ContentView.Content>
<Grid Padding="5,8" ColumnSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label
x:Name="LabelText"
Grid.Column="0"
HorizontalTextAlignment="Start"
VerticalTextAlignment="Center"/>
<Label
x:Name="ValueText"
Grid.Column="1"
HorizontalTextAlignment="End"
VerticalTextAlignment="Center"/>
</Grid>
</ContentView.Content>
</ContentView>
- Your new grid code has only 1 row defined, but 6 rows used. Furthermore, Even if you fix the row count,
Height="10"means each row is only 10 pixels tall, text gets clipped and invisible. What's more,AttendanceLabelis on the wrong row.
Code example:
<?xml version="1.0" encoding="UTF-8"?>
<ContentView
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TourGrosses.Controls.ArtistSummaryItem"
Style="{DynamicResource ContentViewBase}"
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui">
<ContentView.Content>
<StackLayout
Orientation="Vertical"
Spacing="5"
Padding="5"
BackgroundColor="{DynamicResource ArtistTourDetailBackground}">
<StackLayout Spacing="10" Padding="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<telerik:RadBorder
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
CornerRadius="8">
<Label
x:Name="ArtistLabel"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
Style="{DynamicResource ArtistSummaryTitle}"/>
</telerik:RadBorder>
</Grid>
</StackLayout>
<Grid ColumnSpacing="10" RowSpacing="8" Padding="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Text="No. Shows"
Grid.Column="0" Grid.Row="0"
HorizontalTextAlignment="Start"/>
<Label x:Name="NoShowsLabel"
Grid.Column="1" Grid.Row="0"
HorizontalTextAlignment="End"/>
<Label Text="Attendance"
Grid.Column="0" Grid.Row="1"
HorizontalTextAlignment="Start"/>
<Label x:Name="AttendanceLabel"
Grid.Column="1" Grid.Row="1"
HorizontalTextAlignment="End"/>
<Label Text="Gross"
Grid.Column="0" Grid.Row="2"
HorizontalTextAlignment="Start"/>
<Label x:Name="GrossLabel"
Grid.Column="1" Grid.Row="2"
HorizontalTextAlignment="End"/>
<Label Text="Per Head"
Grid.Column="0" Grid.Row="3"
HorizontalTextAlignment="Start"/>
<Label x:Name="PerHeadLabel"
Grid.Column="1" Grid.Row="3"
HorizontalTextAlignment="End"/>
<Label Text="Products Sold"
Grid.Column="0" Grid.Row="4"
HorizontalTextAlignment="Start"/>
<Label x:Name="ProductsSoldLabel"
Grid.Column="1" Grid.Row="4"
HorizontalTextAlignment="End"/>
</Grid>
</StackLayout>
</ContentView.Content>
</ContentView>
- Your app uses
{DynamicResource}for theming. In .NET 10, the resource resolution pipeline became stricter. If yourResourceDictionarydoesn't properly define dark/light variants usingAppThemeBinding, the dark theme is silently ignored and always falls back to the light version.
Colors.xaml
<?xml version="1.0" encoding="UTF-8"?>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Color x:Key="ArtistTourDetailBackground">
<AppThemeBinding Light="#F5F5F5" Dark="#1C1C1E"/>
</Color>
<Color x:Key="ArtistSummaryTitleColor">
<AppThemeBinding Light="#212121" Dark="#FAFAFA"/>
</Color>
<Color x:Key="TourDetailLabelColor">
<AppThemeBinding Light="#333333" Dark="#CCCCCC"/>
</Color>
<Color x:Key="TourDetailValueColor">
<AppThemeBinding Light="#000000" Dark="#FFFFFF"/>
</Color>
</ResourceDictionary>
App.xaml
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml"/>
<ResourceDictionary Source="Resources/Styles/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback.