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

25421- ListViewRenderer Crash in HostApp and BindingError was occured in windows platforms #25440

Closed
wants to merge 2 commits into from

Conversation

SuthiYuvaraj
Copy link
Contributor

@SuthiYuvaraj SuthiYuvaraj commented Oct 22, 2024

RootCause

ListViewRenderer Crash on HostApp

As the HostApp uses a ListView to display a list of items, selecting a page navigates to the corresponding test cases and sets the sample page as the current main page. This action disposes the HostApp's main page, which contains the ListView. As a result, the previous list is also disposed, leading to a crash in the ListViewRenderer during the OnControlSelectionChanged event.

BindingErrors occurs on windows platform

In the HostApp, the pages private field of the ListView is set as the BindingContext of the ListView, which is causing the issue. The pages field is directly assigned to the ItemsSource, so there's no need to set the BindingContext. The problem arises because the same collection is being used for both the BindingContext and the ItemsSource, which is the root cause of the issue.

Description of Change

ListViewRenderer Crash on HostApp

Ensuring that Element is not null before updating the selection will resolve the issue

BindingErrors occurs on windows platform

There is no need to define the BindingContext.

Issues Fixed

Fixes #25421

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 22, 2024
Copy link
Contributor

Hey there @SuthiYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@SuthiYuvaraj SuthiYuvaraj marked this pull request as ready for review October 22, 2024 09:29
@SuthiYuvaraj SuthiYuvaraj requested a review from a team as a code owner October 22, 2024 09:29
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@@ -802,6 +802,9 @@ void OnListItemClicked(object sender, ItemClickEventArgs e)

void OnControlSelectionChanged(object sender, WSelectionChangedEventArgs e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we validate if this subscription needs to be removed?

List.SelectionChanged += OnControlSelectionChanged;

I'm still wondering if the handler is getting disconnected and we're not disconnecting all the proper events

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PureWeen In Windows, the view renderer is not being disconnected properly. Currently, all events are only disconnected in the Dispose() method. We should override DisconnectHandlerCore(like below code) for all view renderers and ensure all events are properly disconnected. As a short-term fix to resolve the UI test case issue, we added a null check for Element
private protected override void DisconnectHandlerCore()
{
// disconnect all the events.
}

@PureWeen
Copy link
Member

closing this one in favor of
#25453

@PureWeen PureWeen closed this Oct 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2024
@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 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 partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows 🪟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ListViewRenderer Crash in HostApp
4 participants