maui icon indicating copy to clipboard operation
maui copied to clipboard

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

Open vishnumenon2684 opened this issue 1 year ago • 8 comments
trafficstars

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

The ListView events are unwired, and resources are cleaned up in the DisconnectHandlerCore method of the ListView renderer, ensuring all events are properly disconnected.

BindingErrors occurs on windows platform

There is no need to define the BindingContext.

Issues Fixed

Fixes #25421

vishnumenon2684 avatar Oct 22 '24 14:10 vishnumenon2684

@dotnet-policy-service agree

vishnumenon2684 avatar Oct 22 '24 14:10 vishnumenon2684

/azp run

jsuarezruiz avatar Oct 23 '24 13:10 jsuarezruiz

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

azure-pipelines[bot] avatar Oct 23 '24 13:10 azure-pipelines[bot]

/rebase

PureWeen avatar Oct 23 '24 17:10 PureWeen

/rebase

PureWeen avatar Oct 23 '24 19:10 PureWeen

/rebase

PureWeen avatar Oct 23 '24 20:10 PureWeen

/azp run

jsuarezruiz avatar Oct 24 '24 13:10 jsuarezruiz

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

azure-pipelines[bot] avatar Oct 24 '24 13:10 azure-pipelines[bot]

https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10441841&view=results https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10441761&view=results https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10441842&view=results

PureWeen avatar Oct 24 '24 14:10 PureWeen