-
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
[Windows] Fixed TextCell Command executes only once #25066
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
81f60ea
to
9819d87
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
9819d87
to
495347b
Compare
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
5a89db0
to
fa61fae
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/rebase |
} | ||
} | ||
|
||
public class MainViewModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build is failing:
D:\a\_work\1\s\src\Controls\tests\TestCases.HostApp\Issues\Issue25191.xaml.cs(15,15): error CS0101: The namespace 'Maui.Controls.Sample.Issues' already contains a definition for 'MainViewModel' [D:\a\_work\1\s\src\Controls\tests\TestCases.HostApp\Controls.TestCases.HostApp.csproj::TargetFramework=net9.0-tizen]
D:\a\_work\1\s\src\Controls\tests\TestCases.HostApp\Issues\Issue25191.xaml.cs(15,15): error CS0101: The namespace 'Maui.Controls.Sample.Issues' already contains a definition for 'MainViewModel' [D:\a\_work\1\s\src\Controls\tests\TestCases.HostApp\Controls.TestCases.HostApp.csproj::TargetFramework=net9.0-windows10.0.20348.0]
6924 Warning(s)
6 Error(s)
Another sample is already using a MainViewModel, my recommendation here is always use the issue id to create view models etc. For example: Issue21112ViewModel
or Issue21112MainView etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the code based on your feedback. Could you please review it and let me know if there are any further concerns
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Root Cause
While fixing a memory leak in ListView, the Cell's parent was set to null in the Unloaded event. This caused the TextCell's parent to be set to null during initial navigation, preventing commands from executing afterward.
Description of Change
The fix ensures that the parent is set to null only when the parent control is a ListView. This preserves the memory leak fix while also resolving the issue with command execution in TextCell.
Tested the behaviour in the following platforms
Issues Fixed
Fixes #21112
Screenshots
Before.mp4
After.mp4