dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.74k forks source link

TableSection and TableRoot Title properties are displayed as lower case on Windows. #17123

Open apk24 opened 1 year ago

apk24 commented 1 year ago

Description

TableView elements' Title properties don't carry any capitalization.

The following TableView has both upper case and lower case titles, but is rendered with only lower case.

    <TableView Intent="Menu"
               HorizontalOptions="Center">
        <TableRoot Title="TableRoot Title Text">
            <TableSection Title="TableSection Title Text">
                <TextCell Text="TextCell Text"
                          Detail="TextCell Detail" />
                <EntryCell Label="EntryCell Label"
                           Placeholder="EntryCell Placeholder" />
            </TableSection>
        </TableRoot>
    </TableView>

image

See Also: StackOverflow Question

Steps to Reproduce

Create a new .NET MAUI app. Replace all content from MainPage with the above TableView. Compile and Run on Windows.

Link to public reproduction project repository

https://github.com/apk24/dotnet-maui-tableview-titles-bug

Version with bug

7.0.92

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.17763.0

Did you find any workaround?

No response

Relevant log output

No response

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on Windows 11 and iOS 16.4 .NET 8, not repro on Android 13.0-API33 with below Project: MauiApp1.zip

Windows: TableView rendered lower case. image

iOS: TableView rendered upper case. image

danies8 commented 1 year ago

Verify that this issue happened in net 7 vs 17.4. Does it will be fixed in net 8 on November relese ?

ajsuydam commented 4 months ago

Has anyone found a workaround for this?

DanielGramsJTL commented 1 month ago

As workaround for TableSection, i inserted the following to Platforms\Windows\App.xaml:

<maui:MauiWinUIApplication.Resources>
    <ResourceDictionary>
        <DataTemplate x:Key="TableSection">
            <TextBlock Margin="0,20,0,0" Text="{Binding Title}" Style="{ThemeResource SubtitleTextBlockStyle}" Visibility="{Binding Text,RelativeSource={RelativeSource Mode=Self},Converter={StaticResource CollapseWhenEmpty}}" Foreground="{Binding TextColor,Converter={StaticResource ColorConverter},ConverterParameter=DefaultTextForegroundThemeBrush}" />
        </DataTemplate>
    </ResourceDictionary>
</maui:MauiWinUIApplication.Resources>

Original Template from https://github.com/dotnet/maui/blob/68524c8056491da6a40b06dd0c979de1bb40538f/src/Controls/src/Core/Compatibility/Handlers/TableView/Windows/TableViewStyles.xaml#L19C5-L21C20