내 프로그램에서 데이터베이스를 업데이트 할 때 시작 화면을 변경하고 싶습니다. OnLunch 이벤트 처리기를 변경할 때까지는 아무 문제가 없습니다. 조건에 따라 async
키워드를 사용해야합니다.SplashScreen 변경 OnLunch 메서드에 async 키워드가있는 경우
protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
bool IsAppUpdated = await CheckDbVersion();
if(IsAppUpdated)
{
if (args.PreviousExecutionState != ApplicationExecutionState.Running)
{
bool loadState = (args.PreviousExecutionState == ApplicationExecutionState.Terminated);
SplashScreenExtend extendedSplash = new SplashScreenExtend(args.SplashScreen, loadState);
Window.Current.Content = extendedSplash;
}
bool fine = await ReconstructDatabase();
}
//doing sth else
}
문제는 내가 프로그램을 실행할 때 새로운 시작 화면이 나타나지 않는다는 것입니다. 하지만 코드를 디버깅 할 때 스플래시 화면이 나타납니다. 또한, 비동기 키워드를 제거하고 기능을 기다릴 때마다 ok가됩니다.
제발 제 실수는 어디입니까?
MSDN이 항목 [여기 (https://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh868191 (V = win.10) .ASPX 전용 물품을 보유). –