Repository: CommunityToolkit/Maui

Issue #2003: [BUG] Non-nullable are not valid InvalidOperationException is thrown when using VariableMultiValueConverter
Created: 2024-07-06T21:38:30Z
Is there an existing issue for this?

 I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

 I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

Current Behavior
System.InvalidOperationException: 'Non-nullable are not valid'
Expected Behavior
MultiBinding works as it used to in prior versions.
Steps To Reproduce
1- Give MainPage a reference name
x:Name="ThisPage"
2- Copy and paste the following code in MainPage:
    <ContentPage.Resources>
        <toolkit:VariableMultiValueConverter ConditionType="All" x:Key="VariableMultiValueConverterAll" />
        <toolkit:InvertedBoolConverter x:Key="InvertedBoolConverter" />
    </ContentPage.Resources>

    <ScrollView>
        <VerticalStackLayout
            Padding="30,0"
            Spacing="25">
            <VerticalStackLayout.IsEnabled>
                <MultiBinding Converter="{StaticResource VariableMultiValueConverterAll}">
                    <Binding Path="IsEnabled" Source="{x:Reference ThisPage}" Converter="{StaticResource InvertedBoolConverter}" />
                    <Binding Path="IsVisible" Source="{x:Reference ThisPage}" Converter="{StaticResource InvertedBoolConverter}" />
                </MultiBinding>
            </VerticalStackLayout.IsEnabled>
        </VerticalStackLayout>
    </ScrollView>

3- Make sure CommunityToolkit.Maui 9.0.2 is installed
4- Non-nullable are not valid exception is thrown
5- Revert back to CommunityToolkit.Maui 9.0.1 to avoid this issue

Link to public reproduction project repository
https://github.com/usefulBeeing/MauiNonNullableError
Environment
- .NET MAUI CommunityToolkit: 9.0.2
- OS: Windows 10.0.22631 Build 22631
- .NET MAUI: 8.0.61
Anything else?
No response

Duplicate issue #2062: [BUG] EnumToBool Converter causing application crash when used in a data trigger
Created: 2024-07-25T17:55:21Z
Is there an existing issue for this?

 I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

 I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

Current Behavior
When using the EnumToBool converter in a data trigger, the application crashes showing "Non-nullable are not valid" error
Expected Behavior
Converter should be able to be used inside of a data trigger
Steps To Reproduce
Open solution
Run
Link to public reproduction project repository
https://github.com/adlartuten/ToolkitTest
Environment
- .NET MAUI CommunityToolkit:9.0.2
- OS: Windows, Android, iOS
- .NET MAUI:8.0.70
Anything else?
This does not happen on version 9.0.1, it first appeared in 9.0.2

Closing comment (2024-07-25T18:04:08Z): Thanks for this report, it is actually a duplicate of #2003 which has a fix. We haven't released the fix yet but it will be coming soon. For now please stay on 9.0.1 and know that the next published version will include a fix.