-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
{Binding .} doesn't work in release mode #22945
Comments
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:
|
Additional Information : |
Verified this issue with Visual Studio 17.11.0 Preview 1.1 (8.0.40). Can repro on Android platform with sample project. |
@cat0363 there's a bug in your code. There's a mismatch between the Unfortunately, in Debug mode the values of Is this explanation enough? Can I go ahead and close this issue? |
@simonrozsival , Thank you for your explanation. As a side note, I got the expected results by doing the following. [MainPage.xaml]
[MainPage.xaml.cs]
[EmployeeCollection.cs]
[ViewModelMainPage.cs]
[ViewModelEmployee.cs]
|
Description
If you use {Binding .} when a child references a view model that is bound to a parent, it will bind as intended in debug mode, but will not bind correctly in release mode. The reproduction code is shown below.
Below is the screen layout.
[MainPage.xaml]
Below is the view model used in the reproduction code.
[ViewModelMainPage.cs]
[ViewModelEmployee.cs]
[MainPage.xaml.cs]
Below is the result when running in debug mode.
[Debug mode]
Below is the result when running in release mode.
[Release mode]
If you build in release mode, {Binding .} is not working.
Is this way of writing not supported in release mode?
Steps to Reproduce
In step 1, nothing is displayed in the BindableLayout.
Link to public reproduction project repository
https://github.com/cat0363/Maui-IssueReleaseModeNotRendering.git
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11.0, 12.0, 13.0, 14.0
Did you find any workaround?
You can avoid this problem by explicitly specifying the view model without using {Binding .}.
For example, you can avoid this by doing the following:
Relevant log output
No response
The text was updated successfully, but these errors were encountered: