locked
Registering for Network Status and / or Geolocation changes - page or app?

    Question

  • I've been including calls to the relevant stuff on the pages within my app that make use of it.

    Would it be better to instantiate that stuff in the App.xaml.cs and manage it there as part of app life cycle, rather than each individual page managing it's own instance from OnNavigatedTo/From ?


    • Edited by RD8388 Monday, July 21, 2014 10:01 AM
    Monday, July 21, 2014 9:57 AM

Answers

  • Yes, if it's used across the entire app.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, July 21, 2014 7:16 PM
    Moderator

All replies

  • Yes, if it's used across the entire app.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, July 21, 2014 7:16 PM
    Moderator
  • Thanks Matt.

    Please could you point me in the right direction for where to call my geolocation class in the App.xaml.cs ?

    I'm also not sure what the best way to make the values captured from "OnGeolocationPositionChanged" available to any page. Do I need to store them in ApplicationDataContainer or is there a way to expose my own class properties to every page?

    Thursday, September 11, 2014 6:33 PM