-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to create extended spalsh screen? #1714
Comments
I believe the smartest thing you can do is to wait to set the Window.Content. That being said, extended splash screen hasn't been on my radar. Thanks for the tip. I will look into building a sample here in a bit. If there is something fundamentally missing in this updated Template10, I'll fix it. |
This works flawlessly. public override async Task OnStartAsync(IStartArgs args)
{
if (args.StartKind == StartKinds.Launch)
{
ShowExtendedSplashScreen();
PreloadData();
await NavigateToStart();
}
else { Debugger.Break(); }
void ShowExtendedSplashScreen()
{
if (args.Arguments is IActivatedEventArgs act)
{
Window.Current.Content = new ExtendedSplash(act.SplashScreen);
}
}
void PreloadData()
{
// TODO
}
async Task NavigateToStart()
{
var navigation = Container.Resolve<Services.NavigationService>();
Window.Current.Content = new ShellPage(navigation.Service.GetXamlFrame());
await navigation.Service.NavigateAsync(nameof(MainPage));
}
} With this ExSplash logic. public ExtendedSplash(Windows.ApplicationModel.Activation.SplashScreen splashScreen)
{
InitializeComponent();
Window.Current.SizeChanged += (s, e) => Resize(splashScreen);
SplashImage.ImageOpened += (s, e) => Window.Current.Activate();
Resize(splashScreen);
}
private void Resize(SplashScreen splashScreen)
{
SplashImage.Height = splashScreen.ImageLocation.Height;
SplashImage.Width = splashScreen.ImageLocation.Width;
SplashContainer.SetValue(Canvas.TopProperty, splashScreen.ImageLocation.Top);
SplashContainer.SetValue(Canvas.LeftProperty, splashScreen.ImageLocation.Left);
} I'll keep it on the backlog to remove |
Thank you for hint. |
In old T10 version there was a way to create extended splash screen in app constructor SplashFactory = (e) => new Views.Splash(e); There is solution to override OnLaunched method in standard UWP App. Unfortunate this method is sealed in Template 10.
I did not find any description ow web. Please will you point me out where is some docs describing my problem. Thanks in advance.
The text was updated successfully, but these errors were encountered: