Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Xamarin.Forms.Platform.WinPhone.FormsApplicationPage.OnDeactivated null reference exception

$
0
0

When the application loses his focus (e.g. open the browser) following exception will be thrown:

System.NullReferenceException: Object reference not set to an instance of an object.
at Xamarin.Forms.Platform.WinPhone.FormsApplicationPage.OnDeactivated(Object sender, DeactivatedEventArgs e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Microsoft.Phone.Shell.PhoneApplicationService.FireDeactivated(UInt32 reason)
at Microsoft.Phone.TaskModel.Interop.ITask.Pause.Invoke(UInt32 reason)
at Microsoft.Phone.TaskModel.Interop.Task.FireOnPause(UInt32 reason)

I didnt modify the App.xaml:

<Application.ApplicationLifetimeObjects>
    
    <shell:PhoneApplicationService
        Launching="Application_Launching" Closing="Application_Closing"
        Activated="Application_Activated" Deactivated="Application_Deactivated"/>
</Application.ApplicationLifetimeObjects>

After the defined method "Application_Deactivated" has been called, the application crashes.
(There isnt any code in that method who could cause anything)


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>