-
Notifications
You must be signed in to change notification settings - Fork 359
Description
Describe the bug
I start to have a problem with the last version of CommunityToolkit.Mvvm 8.4.0 (I tried 8.3.2 too), where it fails to change an Observable Property when using RelativeSource AncestorType on Release mode.
So, I have a user control that appears every time the MessageShow changed to True in ViewModel. After click on a button inside of the control, the same property is changed to False.
Every time I need to show the control a do the same.
It stop to work after I update Toolkit and SDKs.
Here is a sample, works in Debug but fails in Release mode:
<controls:CPopUps BindingContext="{Binding Source={RelativeSource AncestorType={x:Type viewmodels:DebugViewModel}}}"
MessageShow="{Binding PopUpMessageShow, Source={RelativeSource AncestorType={x:Type viewmodels:DebugViewModel}}, Mode=OneWay}" />
I tried to disable AOT and Trimmed but no luck.
So I found this approach and it worked:
<controls:CPopUps BindingContext="{Binding Source={RelativeSource AncestorType={x:Type viewmodels:DebugViewModel}}}"
MessageShow="{Binding PopUpMessageShow, Mode=OneWay}" />
Don't know if a BUG or bad usage, but was working in the past...
Regression
SDK 9.0.202
Steps to reproduce
- Create a user control with Binding properties;
- Put it on a View;
- Change the property from ViewModel;
- Change the property in User Control;
- Property is not changed on ViewModel;
Expected behavior
Observable Property should be updated on ViewModel after it's changed in the user control.
Screenshots
No response
IDE and version
VS 2022
IDE version
17.14.9
Nuget packages
- CommunityToolkit.Common
- CommunityToolkit.Diagnostics
- CommunityToolkit.HighPerformance
- CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)
8.4.0
Additional context
No response
Help us help you
No, just wanted to report this