FAKE ERROR REPORTING

Giorgio Sfiligoi 481 Reputation points
2025-10-24T20:00:33.59+00:00

In my MET MAUI app I have a popup where the user is supposed to enter a password. Following is a partial snippet:

<Entry x:Name="password" IsPassword="True" HorizontalOptions="Fill" />

<Button Text="OK" Margin="20,0"
        Command="{Binding AcceptCommand}"
        CommandParameter="{Binding Text, Source={x:Reference password}, Mode=OneWay, x:DataType='Entry'}"/>

When the button 'OK' is clicked, it reports the password in the CommandParameter.

Oddly the compiler higlights Binding Text and reports the error: 'Text' is not accessible.

However, the compilation completes successfully and the program runs - then it was not an error after all.

This happens both in NET 9.0 and NET 10. I am using VS 2026.

Can anybody explain this apparent inconsistency, and suggest a method to avoid this annoying fake error?

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.