mirror of
https://github.com/ReneLergner/WPinternals.git
synced 2026-06-20 14:11:02 +10:00
Fixed the UI for phone shut down
This commit is contained in:
@@ -170,9 +170,23 @@ namespace WPinternals
|
|||||||
{
|
{
|
||||||
IsSwitching = false;
|
IsSwitching = false;
|
||||||
if ((UIContext == null) || (SynchronizationContext.Current == UIContext))
|
if ((UIContext == null) || (SynchronizationContext.Current == UIContext))
|
||||||
ModeSwitchSuccess((IDisposable)PhoneNotifier.CurrentModel, (PhoneInterfaces)PhoneNotifier.CurrentInterface);
|
{
|
||||||
|
if (PhoneNotifier.CurrentInterface == null)
|
||||||
|
{
|
||||||
|
ModeSwitchErrorWrapper("Phone disconnected");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ModeSwitchSuccess((IDisposable)PhoneNotifier.CurrentModel, (PhoneInterfaces)PhoneNotifier.CurrentInterface);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
UIContext.Post(s => { ModeSwitchSuccess((IDisposable)PhoneNotifier.CurrentModel, (PhoneInterfaces)PhoneNotifier.CurrentInterface); }, null);
|
{
|
||||||
|
if (PhoneNotifier.CurrentInterface == null)
|
||||||
|
{
|
||||||
|
UIContext.Post(s => { ModeSwitchErrorWrapper("Phone disconnected"); }, null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
UIContext.Post(s => { ModeSwitchSuccess((IDisposable)PhoneNotifier.CurrentModel, (PhoneInterfaces)PhoneNotifier.CurrentInterface); }, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~SwitchModeViewModel()
|
~SwitchModeViewModel()
|
||||||
@@ -259,12 +273,12 @@ namespace WPinternals
|
|||||||
{
|
{
|
||||||
case null:
|
case null:
|
||||||
((NokiaFlashModel)CurrentModel).Shutdown();
|
((NokiaFlashModel)CurrentModel).Shutdown();
|
||||||
ModeSwitchProgressWrapper("Shutting down phone...", null);
|
ModeSwitchProgressWrapper("Please disconnect your device. Waiting...", null);
|
||||||
LogFile.Log("Shutting down phone", LogType.FileAndConsole);
|
LogFile.Log("Please disconnect your device. Waiting...", LogType.FileAndConsole);
|
||||||
new Thread(() =>
|
new Thread(() =>
|
||||||
{
|
{
|
||||||
PhoneNotifier.WaitForRemoval().Wait();
|
PhoneNotifier.WaitForRemoval().Wait();
|
||||||
//ModeSwitchSuccessWrapper(); TODO: Display UI
|
ModeSwitchSuccessWrapper();
|
||||||
}).Start();
|
}).Start();
|
||||||
break;
|
break;
|
||||||
case PhoneInterfaces.Lumia_Normal:
|
case PhoneInterfaces.Lumia_Normal:
|
||||||
|
|||||||
Reference in New Issue
Block a user