// Called from an event-handler. So, "async void" is valid here. internal async void FlashArchive(string ArchivePath) { IsSwitchingInterface = true; // Prevents that a device is forced to Flash mode on this screen which is meant for flashing try { await SwitchModeViewModel.SwitchToWithProgress(PhoneNotifier, PhoneInterfaces.Lumia_Flash, (msg, sub) => ActivateSubContext(new BusyViewModel(msg, sub))); if (((NokiaFlashModel)PhoneNotifier.CurrentModel).ReadPhoneInfo(ExtendedInfo: false).FlashAppProtocolVersionMajor < 2) { FlashArchiveTask(ArchivePath); } else { await Task.Run(async() => await LumiaV2UnlockBootViewModel.LumiaV2FlashArchive(PhoneNotifier, ArchivePath, SetWorkingStatus, UpdateWorkingStatus, ExitSuccess, ExitFailure)); } } catch (Exception Ex) { ActivateSubContext(new MessageViewModel(Ex.Message, Callback)); } }