public ExtSplashScreen(Windows.ApplicationModel.Activation.SplashScreen splashScreen, bool loadState) { this.InitializeComponent(); this.BottomAppBar.Visibility = Windows.UI.Xaml.Visibility.Collapsed; this.ProgressGrid.Visibility = Windows.UI.Xaml.Visibility.Visible; // Listen for window resize events to reposition the extended splash screen image accordingly. // This ensures that the extended splash screen formats properly in response to window resizing. Window.Current.SizeChanged += new WindowSizeChangedEventHandler(SplashScreen_OnResize); LayoutUpdated += SplashScreen_LayoutUpdated; splash = splashScreen; if (splash != null) { // Register an event handler to be executed when the splash screen has been dismissed. splash.Dismissed += new TypedEventHandler <Windows.ApplicationModel.Activation.SplashScreen, Object>(DismissedEventHandler); // Retrieve the window coordinates of the splash screen image. splashImageRect = splash.ImageLocation; Position(); } // Create a Frame to act as the navigation context rootFrame = new Frame(); // Restore the saved session state if necessary //RestoreStateAsync(loadState); }
// Include code to be executed when the system has transitioned from the splash screen to the extended splash screen (application's first view). async void DismissedEventHandler(Windows.ApplicationModel.Activation.SplashScreen sender, object e) { dismissed = true; // Complete app setup operations here... await DismissExtendedSplash(); }
public Splash(Windows.ApplicationModel.Activation.SplashScreen splashScreen, Services.IManifestService manifestService) { _manifestService = manifestService; this.InitializeComponent(); // setup size Action resize = () => { MyImage.Height = splashScreen.ImageLocation.Height; MyImage.Width = splashScreen.ImageLocation.Width; MyImage.SetValue(Canvas.TopProperty, splashScreen.ImageLocation.Top); MyImage.SetValue(Canvas.LeftProperty, splashScreen.ImageLocation.Left); }; MyImage.ImageOpened += (s, e) => Window.Current.Activate(); Window.Current.SizeChanged += (s, e) => resize(); resize(); // background color var splashColor = _manifestService.SplashBackgroundColor; var splashBrush = new SolidColorBrush(splashColor); MyGrid.Background = splashBrush; // splash image var splashPath = _manifestService.SplashImage; var splashUrl = System.IO.Path.Combine("ms-appx:///", splashPath); var splashUri = new Uri(splashUrl); var splashImg = new BitmapImage(splashUri); MyImage.Source = splashImg; }
public ExtSplashScreen(Windows.ApplicationModel.Activation.SplashScreen splashScreen, bool loadState) { this.InitializeComponent(); this.BottomAppBar.Visibility = Windows.UI.Xaml.Visibility.Collapsed; this.ProgressGrid.Visibility = Windows.UI.Xaml.Visibility.Visible; // Listen for window resize events to reposition the extended splash screen image accordingly. // This ensures that the extended splash screen formats properly in response to window resizing. Window.Current.SizeChanged += new WindowSizeChangedEventHandler(SplashScreen_OnResize); LayoutUpdated += SplashScreen_LayoutUpdated; splash = splashScreen; if (splash != null) { // Register an event handler to be executed when the splash screen has been dismissed. splash.Dismissed += new TypedEventHandler<Windows.ApplicationModel.Activation.SplashScreen, Object>(DismissedEventHandler); // Retrieve the window coordinates of the splash screen image. splashImageRect = splash.ImageLocation; Position(); } // Create a Frame to act as the navigation context rootFrame = new Frame(); // Restore the saved session state if necessary //RestoreStateAsync(loadState); }
public Splash(Windows.ApplicationModel.Activation.SplashScreen splash) { // TODO: Complete member initialization this.InitializeComponent(); /* this.extendedSplashImage.SetValue(Canvas.LeftProperty, splash.ImageLocation.X); * this.extendedSplashImage.SetValue(Canvas.TopProperty, splash.ImageLocation.Y); * this.extendedSplashImage.Height = splash.ImageLocation.Height; * this.extendedSplashImage.Width = splash.ImageLocation.Width; */ // Position the extended splash screen's progress ring. this.ProgressRing.SetValue(Canvas.TopProperty, splash.ImageLocation.Y + splash.ImageLocation.Height + 32); this.ProgressRing.SetValue(Canvas.LeftProperty, splash.ImageLocation.X + (splash.ImageLocation.Width / 2) - 15); }
public Splash(Windows.ApplicationModel.Activation.SplashScreen splashScreen, Nullable <Color> splashBackground = null, Uri splashImage = null) { this.InitializeComponent(); // defaults if (splashBackground == null) { splashBackground = Colors.Red; } this.Background = new SolidColorBrush(Colors.Red); if (splashImage == null) { splashImage = new Uri("ms-appx:///Assets/SplashScreen.png"); } SplashImage.ImageOpened += (s, e) => Window.Current.Activate(); SplashImage.ImageFailed += (s, e) => Window.Current.Activate(); SplashImage.Source = new BitmapImage(splashImage); // setup resize Action resize = () => { SplashImage.Stretch = Stretch.Uniform; SplashImage.Height = splashScreen.ImageLocation.Height; SplashImage.Width = splashScreen.ImageLocation.Width; var t = new TranslateTransform { X = splashScreen.ImageLocation.Left, Y = splashScreen.ImageLocation.Top, }; SplashImage.RenderTransform = t; }; // init Window.Current.SizeChanged += (s, e) => resize(); resize.Invoke(); }
public SplashPage(Windows.ApplicationModel.Activation.SplashScreen splashScreen) { this.InitializeComponent(); }
public SplashPage(Windows.ApplicationModel.Activation.SplashScreen splashScreen) { InitializeComponent(); Window.Current.Activate(); }