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

[Windows] Fixed TextCell Command executes only once #25066

Merged
merged 9 commits into from
Oct 30, 2024

Conversation

Vignesh-SF3580
Copy link
Contributor

@Vignesh-SF3580 Vignesh-SF3580 commented Oct 3, 2024

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

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #21112

Screenshots

Before Issue Fix After Issue Fix
Before.mp4
After.mp4

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 3, 2024
@dotnet dotnet deleted a comment from azure-pipelines bot Oct 7, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Vignesh-SF3580 Vignesh-SF3580 marked this pull request as ready for review October 9, 2024 13:42
@Vignesh-SF3580 Vignesh-SF3580 requested a review from a team as a code owner October 9, 2024 13:42
@Vignesh-SF3580
Copy link
Contributor Author

/rebase

@PureWeen
Copy link
Member

PureWeen commented Oct 9, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Vignesh-SF3580
Copy link
Contributor Author

/rebase

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen changed the title [Winodws] Fixed TextCell Command executes only once [Windows] Fixed TextCell Command executes only once Oct 14, 2024
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

/rebase

@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Vignesh-SF3580
Copy link
Contributor Author

/rebase

}
}

public class MainViewModel
Copy link
Contributor

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.

Copy link
Contributor Author

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

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen merged commit 33042f1 into dotnet:main Oct 30, 2024
107 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 30, 2024
@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
@samhouts samhouts added fixed-in-9.0.10 fixed-in-net8.0-nightly This may be available in a nightly release! labels Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-listview ListView and TableView community ✨ Community Contribution fixed-in-9.0.10 fixed-in-net8.0-nightly This may be available in a nightly release! partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows 🪟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TableView TextCell command executes only once
6 participants