locked
NFC checking your MessageReceivedHandler early RRS feed

  • Question

  • When detecting a nearby device, is it possible to execute the MessageReceivedHandler in the DeviceArrived Event? I'm not sure how to get the ProximityMessage from the ProximityDevice. The purpose is when a device arrives, I need to know immediately whether it has content; in fact, getting the handler to execute first would be optimal, but I doubt that's possible. I thought, alternatively, of a workaround that involved using the Dispatcher, but because the Dispatcher would run later (not UI thread) it didn't help.  I'm not a threading expert; maybe someone can enlighten me as to how to break from the thread for an instant to execute code, without the dispatcher (something that runs immediately, hopefully). Any help is appreciated.
    Friday, February 7, 2014 10:10 PM

All replies

  • I'm confused by your statement about the Dispatcher - why isn't it running on the UI thread?  What's the pseudo code for what you're doing?

    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, February 10, 2014 2:11 PM