Hi,
I use the SfTabView to load content page inside.
It works well however these are very complex page with loading to api in my view model ...
What is the best way to lazy load complex pages?
Now I set the content like this:
My mainview hosts the sftabview:
MainView
public MainView(IPageService pageService)
{
_pageService = pageService;
InitializeComponent();
_pageService.CreatePage(typeof(DashboardView), null).ContinueWith((result) =>
{
dbView = result.Result as DashboardView;
dboardTab.Content = dbView.Content;
});
}
private async MainPage_Appearing(object sender, System.EventArgs e)
{
await Task.Run(async () =>
{
(dbView.BindingContext as DashboardViewModel).Init(null);
profileView = await _pageService.CreatePage(typeof(ProfileView), null) as ProfileView;
adminView = await _pageService.CreatePage(typeof(AdminView), null) as AdminView;
Device.BeginInvokeOnMainThread(async () =>
{
profileTab.Content = profileView.Content;
adminTab.Content = adminView.Content;
});
}).ConfigureAwait(false);
}
In this approach my UI is very long to load. I would like to lazy load my pages.
What are the best practices?
Thanks,