Open FPotel opened 11 months ago
Hello FPotel, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.
This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.
This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.
This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.
This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.
Describe the bug
I created a UserControl that contains a DataGrid, which contains one DataGridTemplateColumn, which contains a checkbox. The IsChecked of that checkbox is binded with an ObservableProperty of a POCO class. When clicking randomly on the checkboxes, and setting a breakpoint into the event OnChecked, we can see that we pass several times into it, and the datacontext linked to the checkbox is sometimes null. I set another breakpoint in the code generated by my UserControl (.g.cs file) into the Connect function, and I can observe that the thread pass several times into the code of the checkbox creation. The fact the checkbox is binded to an Observable Property makes the bug happen (with a regular property, no bug). If I delete the ObservableProperty tag on the property, and I raise a OnPropertyChanged event in the setter, I also observe the bug.
Regression
No response
Reproducible in sample app?
Steps to reproduce
Expected behavior
I can't explain why the fact I binded the IsChecked property of my Checkbox to an ObservableProperty in my model triggers the creation of ghost checkbox (with null datacontext). I found a workaround for my code, but thouht it was worth it reporting this behavior.
Screenshots
No response
Windows Build Number
Other Windows Build number
Windows 11 22H2
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
2022
Visual Studio Build Number
No response
Device form factor
No response
Nuget packages
CommunityToolkit.WinUI.UI.Controls 7.1.2 CommunityToolkit.Mvvm 8.2.2
Additional context
No response
Help us help you
No.