private void Current_Activated(object sender, WindowActivatedEventArgs e)
{
var win = sender as Window;
//#if WINDOWS_PHONE_APP
// if (e. != CoreWindowActivationState.Deactivated)
// {
// Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
// }
// else
// {
// Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
// }
//# el
#if WINDOWS_UWP
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
{
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
}
else
{
Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
}
}
if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
{
SubscribeToBackRequestedEvent();
}
else
{
UnsubscribeFromBackRequestedEvent();
}
#endif
}