Open jai-io opened 1 week ago
i'm experiencing the same issue with 2.0.0-rc2, any workarounds for this?
The same for me. Exceptionis on all platforms, Win, iOS, Android. On Android there is 'Unable to cast to ContentViewGroup' exception. This happened only after upgrading Microsoft.Maui.Controls to version 9.0.10 from 8 on net9. So i'm not sure if this is addresed to MS or LiveCharts. Also tried latest rc 4.5 of LiveCharts, but behavior is the same. After spending a couple of endless nigths, i have still no workaround.
Looks like this is due to changes in .NET 9 in the way custom control using handlers are cleaned up: Handler disconnection.
Adding HandlerProperties.DisconnectPolicy="Manual"
to the control seems to fix the issue. As an example:
<maui:CartesianChart
Grid.Column="1"
HandlerProperties.DisconnectPolicy="Manual"
HeightRequest="52"
Margin="-16,0,0,0"
Series="{Binding Source={RelativeSource AncestorType={x:Type report:StockReportSummaryViewModel}}, Path=StockSummaryPrices.Series}"
XAxes="{Binding Source={RelativeSource AncestorType={x:Type report:StockReportSummaryViewModel}}, Path=StockSummaryPrices.XAxes}"
YAxes="{Binding Source={RelativeSource AncestorType={x:Type report:StockReportSummaryViewModel}}, Path=StockSummaryPrices.YAxes}"
TooltipPosition="Hidden" />
Describe the bug When navigating away from a page containing a LiveChart graph using the back button, the application throws the following casting exception:
To Reproduce Steps to reproduce the behavior:
Environment:
Additional context While I haven't thoroughly investigated the Android platform, preliminary observations suggest this issue is also present there.