The performance issue you're experiencing when setting Application.Current.MainPage
to your custom page could be due to several factors. Here are some potential causes and solutions to improve the performance:
- Page Initialization Overhead
- Cause: If your custom page has complex UI elements, heavy data bindings, or resource-intensive operations (like large images, heavy layouts, or network calls), it might take longer to render.
- Solution: Optimize the UI by reducing unnecessary complexity. Consider lazy loading certain elements or delaying resource-heavy operations until after the page is displayed. For example, use placeholders for images or data that can load asynchronously.
- Resource Dictionaries and Styles
- Cause: If your custom page uses multiple resource dictionaries, styles, or large amounts of XAML, these can slow down the page rendering.
- Solution: Minimize the use of large resource dictionaries or styles that are not essential. Consolidate or defer the loading of certain resources where possible.
if you think it useful, could you accpet my answer