Simple, flexible, interactive & powerful charts, maps and gauges for .Net, LiveCharts2 can now practically run everywhere Maui, Uno Platform, Blazor-wasm, WPF, WinForms, Xamarin, Avalonia, WinUI, UWP.
Currently, the MAUI MotionCanvas queries MainDisplayInfo on every paint in order to fetch the screen density.
Querying MainDisplayInfo on Android (11, at least) drops into Java interop to call system services - this can take a decent chunk of time, occasionally upwards of 15% of the total paint time in the application I'm profiling.
This PR tweaks the MotionCanvas to query MainDisplayInfo once in the constructor, then register a MainDisplayInfoChanged handler to update it if truly necessary.
Tested on Android, iOS, and Windows with no issues.
Currently, the MAUI MotionCanvas queries MainDisplayInfo on every paint in order to fetch the screen density. Querying MainDisplayInfo on Android (11, at least) drops into Java interop to call system services - this can take a decent chunk of time, occasionally upwards of 15% of the total paint time in the application I'm profiling.
This PR tweaks the MotionCanvas to query MainDisplayInfo once in the constructor, then register a MainDisplayInfoChanged handler to update it if truly necessary.
Tested on Android, iOS, and Windows with no issues.