I am working on a Windows 8.1 Metro app. The app gives a personalized experience to the user who is logged in to Windows with his Live account.
As provided in Windows, any user can connect/disconnect his live account to the PC via PC Settings -> Account. My requirement is to be notified at this event, i.e., whenever user connects/disconnects his live account to PC. Now, as per MSDN page (http://msdn.microsoft.com/en-us/library/windows/apps/hh977056.aspx) this event would trigger OnlineIdConnectedStateChange. I was able to implement a background task in the app that listens to the trigger and it is working perfectly fine. Everytime, a change occurs in connected Live account, the event listener is fired. But I am not able to determine the fact if the user logged in with some Live account or logged out from an already connected account.
I tried using Windows.Security.Authentication.OnlineId.OnlineIdAuthenticator
as mentioned in (Metro App - How to detect if logged in with Live ID or Local Account) but this triggers the Authentication flow if no user is logged in. This is not what I want. I just want to know the fact if someone is logged in or not. I don't want to trigger an Auth flow.
Is there any way to determine the logged in/out status of the user when the OnlineIdConnectedStateChange event is fired in the background task?
Thanks for any help.