locked
How to know if the Silverlight control is working well? RRS feed

  • Question

  • Hi guys,

    I'm new to Silverlight. I have a Silverlight control in my web page. I want to know if there is a way that can figure out whether this Silverlight control is working well or not. For example, if the content of the control cannot be shown properly, or if the control is encountering any issues, is there any way to detect/find it?

    Thanks in advance!

    Wednesday, January 11, 2012 9:58 AM

Answers

  • That really depends on your app and how you write it. Generally you can catch errors (and you should!). You could write code that then posts status back to the server using the WebClient class or a WCF service/servicereference.

    It gets a little trickier if the entire app crashes. I believe you could detect this in the hosting HTML page using JavaScript, and similarly post data back to the server, but in that case, error details would be very limited.

    Thursday, January 12, 2012 11:07 PM

All replies

  • You hit F5 and run the application to see if it works? Ie. does it display correctly, and doesn't throw any exceptions (Visual Studio will break if that happens).

    Is that what you mean?

    Thursday, January 12, 2012 11:17 AM
  • another way to find if the control "working well" is check to see if it behaves the way as you expected.

    Thursday, January 12, 2012 5:02 PM
  • Hi SharpGIS,

    Thanks for your reply. What I mean is that I need to know maybe from server side how the control works rather than from the perspective of human (hit F5 as you said). From what you said I guess I will get exception from my code if the control is not working well, right? Another quesion is that, can this method cover all the cases? For example, I have a power view chart (a silverlight control), if the data of the chart cannot be displayed properly, will I get any exceptions?

    Thanks,

    Lu

    Thursday, January 12, 2012 9:02 PM
  • That really depends on your app and how you write it. Generally you can catch errors (and you should!). You could write code that then posts status back to the server using the WebClient class or a WCF service/servicereference.

    It gets a little trickier if the entire app crashes. I believe you could detect this in the hosting HTML page using JavaScript, and similarly post data back to the server, but in that case, error details would be very limited.

    Thursday, January 12, 2012 11:07 PM
  • Hi,

        If you have a public property which is binded to the power view chart, try to place a breakpoint on the getter. It will help you to see whether it is binded properly as well as an clear idea about the content in the property from the object graph(with the help of Visual Studio Quick Watch)

    Thanks,

    Bimal

    Thursday, January 12, 2012 11:11 PM