FluentAvalonia icon indicating copy to clipboard operation
FluentAvalonia copied to clipboard

Question: How to add custom splashscreen with IApplicationSplashScreen.SplashScreenContent

Open squirrelfeng opened this issue 2 years ago • 0 comments

Hello, is it possible to register services in IApplicationSplashScreen.SplashScreenContent?

I use below cold to implement splashscreen, and in my SplashScreenTest, I will use RunTasks() to register some services, which my MainWindowViewModel rely on these services to create a new instance.

However, as RunTasks() is in new thread, so code will directly run 'DataContext = new MainWindowViewModel();' without waiting for SplashScreen to finish tasks.

Do you have any suggestions for my case? Thanks!

public MainWindow() { InitializeComponent(); SplashScreen = new SplashScreenTest(); DataContext = new MainWindowViewModel();

}

squirrelfeng avatar Jul 04 '22 02:07 squirrelfeng