Silverlight - when to call monitor.Stop()

4 posts, 0 answers
  1. Curt
    Curt avatar
    14 posts
    Member since:
    Jan 2012

    Posted 05 Nov 2013 Link to this post

    Can someone please provide some tips on how/when to call monitor.Stop() from a silverlight xap inside of a web browser?  Thanks!
  2. Soren
    Admin
    Soren avatar
    44 posts

    Posted 11 Nov 2013 Link to this post

    Hi Curt,

    This is a notorious difficult scenario, and unfortunately we haven't been able to nail down a rock solid solution for this (since we are building on top of the browser stack so you might be familiar with the issues regarding onbeforeunload etc. ). The issue with ensuring a call to Stop is that this ensures that the recorded data is either send to the server or persisted on the machine. Failing to call Stop, or calling stop at a point where both network and file access is gone holds the risk of losing data.

    So a complete solution may combine the following methods:

    • You can try listening for the Application.Exit event within Silverlight but from our experience both the network and possibly also the ability to write to isolated storage is already gone at this point.
    • You can go to a more elaborate setup, trying to hook into the javascript unloading events that calls back into the silverlight application. We have better success with this though it is not without flaws, as it builds on top of the browsers own ability to detect unloads (which are somewhat flaky). You can get a good explanation here: http://stackoverflow.com/questions/3660560/how-to-detect-a-browser-refresh-from-silverlight-4
     
    Hope this helps to at least outline the possible ways to attack the issue. As mentioned, we haven't been able to nail a rock solid solution but combining the methods above is as close as we've been able to get.

    Let me know if you need further information

    Regards,
    Soren
    Telerik
    ICENIUM MONITOR AVAILABLE FOR DOWNLOAD.
    Monitor and track applications built with Icenium at run-time. Reduce support by fixing run-time crashes as they occur, obtain user insights such as location and system configuration, find and remove application bottlenecks, and track which features are used most to help prioritize development.
    Try Icenium with EQATEC Analytics today >>
  3. Curt
    Curt avatar
    14 posts
    Member since:
    Jan 2012

    Posted 12 Nov 2013 Link to this post

    Thanks Soren. I noticed that the App Exit worked intermittently . I'll investigate the javascript technique.
  4. Soren
    Admin
    Soren avatar
    44 posts

    Posted 13 Nov 2013 Link to this post

    Hi Curt,

    Let me know about your findings

    Regards,

    Soren
    Telerik
    ICENIUM MONITOR AVAILABLE FOR DOWNLOAD.
    Monitor and track applications built with Icenium at run-time. Reduce support by fixing run-time crashes as they occur, obtain user insights such as location and system configuration, find and remove application bottlenecks, and track which features are used most to help prioritize development.
    Try Icenium with EQATEC Analytics today >>
Back to Top