Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Binding with OnIdiom throw this exception on release mode only: InitializeComponent () System.InvalidCastException: Unable to cast object of type 'Microsoft.Maui.Controls.Binding' to type 'System.Boolean'. #24500

Closed
MahmoudAlEssawi opened this issue Aug 29, 2024 · 3 comments · Fixed by #24594
Labels
area-xaml XAML, CSS, Triggers, Behaviors fixed-in-8.0.90 fixed-in-9.0.0-rc.2.24503.2 platform/android 🤖 platform/windows 🪟 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed t/bug Something isn't working
Milestone

Comments

@MahmoudAlEssawi
Copy link

Description

IsVisible="{OnIdiom Default={Binding EditingMode,Converter={StaticResource InvertedBoolConverter}},Phone=False}"
Throw this exception on release mode Only:
InitializeComponent () System.InvalidCastException: Unable to cast object of type 'Microsoft.Maui.Controls.Binding' to type 'System.Boolean'.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.70 SR7

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows

Affected platform versions

WINDOWS 10.0.19045, Android 12

Did you find any workaround?

Remove OnIdiom

Relevant log output

No response

@MahmoudAlEssawi MahmoudAlEssawi added the t/bug Something isn't working label Aug 29, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@jaosnz-rep
Copy link

@MahmoudAlEssawi Can you provide us with a sample project so we can investigate further? Looking forward to your reply!

@PureWeen PureWeen added the s/needs-repro Attach a solution or code which reproduces the issue label Aug 29, 2024
@jaosnz-rep jaosnz-rep added the s/triaged Issue has been reviewed label Aug 30, 2024
@dotnet-policy-service dotnet-policy-service bot added the s/no-recent-activity Issue has had no recent activity label Sep 4, 2024
StephaneDelcroix added a commit that referenced this issue Sep 5, 2024
- fixes #24500
- fixes #16725
@kdotdk
Copy link

kdotdk commented Sep 6, 2024

Same problem exists in windows with OnPlatform using bindings.
E.g.
CanBeDismissedByTappingOutsideOfPopup="{OnPlatform Android=True, WinUI={Binding CanBeDismissedByTappingOutsideOfPopup}, Default=True}"

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue s/no-recent-activity Issue has had no recent activity labels Sep 6, 2024
@samhouts samhouts added this to the .NET 8 SR9 milestone Sep 20, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-xaml XAML, CSS, Triggers, Behaviors fixed-in-8.0.90 fixed-in-9.0.0-rc.2.24503.2 platform/android 🤖 platform/windows 🪟 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants