Skip to content

OnIdiom<GridLength> throws an not implemented Exception (in GridLengthTypeConverter) #29334

@inforithmics

Description

@inforithmics

Description

OnIdiom throws an not implemented Exception (in GridLengthTypeConverter)

Following Xaml throws at runtime a NotSupported Exception

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition>
            <RowDefinition.Height>
                <OnIdiom x:TypeArguments="GridLength" Default="50" Desktop="100"/>
            </RowDefinition.Height>
        </RowDefinition>
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
  
    <Label
        Text="Hello, World!" />
</Grid>

Steps to Reproduce

  1. Create Maui App
  2. Replace MainPage Code with this
<?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="MauiApp3.MainPage">

    <ScrollView>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition>
                    <RowDefinition.Height>
                        <OnIdiom x:TypeArguments="GridLength" Default="50" Desktop="100"/>
                    </RowDefinition.Height>
                </RowDefinition>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
          
            <Label
                Text="Hello, World!" />
        </Grid>
    </ScrollView>

</ContentPage>
  1. Start Application
  2. Crashes with not supported exception

Link to public reproduction project repository

https://github.com/inforithmics/MauiOnIdiomGridLength

Version with bug

9.0.60 SR6

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

All

Did you find any workaround?

No

Similar issues: The workaround from there did not work
#10894

Relevant log output

Metadata

Metadata

Labels

platform/windowss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions