private async Task RestoreCatrobatStateAsync(ApplicationExecutionState executionState)
{
await ((SystemInformationServiceWindowsShared)ServiceLocator.SystemInformationService).Initialize();
if (ViewModelBase.IsInDesignModeStatic)
return;
if (executionState == ApplicationExecutionState.NotRunning ||
executionState == ApplicationExecutionState.ClosedByUser ||
executionState == ApplicationExecutionState.Terminated)
{
Core.App.SetNativeApp(Application.Current.Resources["App"]
as AppWindowsShared);
ServiceLocator.Register(new DispatcherServiceWindowsShared(Dispatcher));
await Core.App.Initialize();
//ServiceLocator.Register(new DispatcherServiceWindowsShared(Dispatcher));
//var width = ServiceLocator.SystemInformationService.ScreenWidth; // preload width
//var height = ServiceLocator.SystemInformationService.ScreenHeight; // preload height
var image = new BitmapImage(
new Uri("ms-appx:///Content/Images/Screenshot/NoScreenshot.png",
UriKind.Absolute))
{
CreateOptions = BitmapCreateOptions.None
};
ManualImageCache.NoScreenshotImage = image;
}
await InitializationFinished(_activationArguments);
}