Describe the bug
Having an XamlLineSeries that is inivisble at startup causes crash.
To Reproduce
- Create a MAUI app from template
- Add a very simple CartesianChart like this:
<lvc:CartesianChart HeightRequest="500" LegendPosition="Top">
<lvc:CartesianChart.Series>
<lvc:SeriesCollection>
<lvc:XamlLineSeries IsVisible="False"/>
</lvc:SeriesCollection>
</lvc:CartesianChart.Series>
</lvc:CartesianChart>
- Build and run. The app window appears but apparently the UI is not constructed from Xaml. After a few seconds the app crashes.
Screenshots

Additional context
- If
LegendPosition="Top" is removed, everything is fine.
- If
IsVisibleAtLegend="True" is added, everything is fine.
- If using
IsVisible="{Binding Visible}" to bind, and Visible has an initial value of false, crash will happen
- If using
IsVisible="{Binding Visible}" to bind, and Visible has an initial value of true, updating it to false will not cause crash. (And the line series is hidden successfully)