Как добавить расширенный всплеск в Windows Template Studio?
Вы можете попробовать отредактировать ActivationService
, как показано ниже
public async Task ActivateAsync(object activationArgs)
{
if (IsInteractive(activationArgs))
{
// Initialize things like registering background task before the app is loaded
await InitializeAsync();
if ((activationArgs as LaunchActivatedEventArgs).PreviousExecutionState != ApplicationExecutionState.Running)
{
bool loadState = ((activationArgs as LaunchActivatedEventArgs).PreviousExecutionState == ApplicationExecutionState.Terminated);
ExtendedSplash extendedSplash = new ExtendedSplash((activationArgs as LaunchActivatedEventArgs).SplashScreen, loadState);
var rootFrame = new Frame();
rootFrame.Content = extendedSplash;
Window.Current.Content = rootFrame;
}
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (Window.Current.Content == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
Window.Current.Content = _shell?.Value ?? new Frame();
}
}
await HandleActivationAsync(activationArgs);
_lastActivationArgs = activationArgs;
if (IsInteractive(activationArgs))
{
// Ensure the current window is active
Window.Current.Activate();
// Tasks after activation
await StartupAsync();
}
}
ExtendedSplash
void DismissExtendedSplash()
{
// Navigate to mainpage
rootFrame.Navigate(typeof(ShellPage));
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}