FluentAvalonia
FluentAvalonia copied to clipboard
Question: How to add custom splashscreen with IApplicationSplashScreen.SplashScreenContent
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();
}