In Windows Phone 8, when I press start button, I should get Application_Deactivated
and Application_Closing
events. But when I set break point in these events, breakpoint doesn't hit. Why Application_Closing
and Application_Deactivated
are not getting called?
Occurs when an application stops being the foreground application.
App.xaml
<Application
x:Class="ContineousLocationTracking.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
<!--Application Resources-->
<Application.Resources>
<local:LocalizedStrings xmlns:local="clr-namespace:ContineousLocationTracking" x:Key="LocalizedStrings"/>
</Application.Resources>
<Application.ApplicationLifetimeObjects>
<!--Required object that handles lifetime events for the application-->
<shell:PhoneApplicationService
Launching="Application_Launching" Closing="Application_Closing"
Activated="Application_Activated" Deactivated="Application_Deactivated"
RunningInBackground="PhoneApplicationService_RunningInBackground"
/>
</Application.ApplicationLifetimeObjects>
</Application>