views:

23

answers:

1

A few of my silverlight pages should provide a custom error message depending on whether an error occurred and what the error is.

I have a custom control that will present the user with the error, however, my question is: Would it be better to add this control into the XAML and just set it as collapsed or visible (depending on whether an error occurred), or create and destroy it dynamically at runtime in the code-behind? What are the implications of each?

Thanks

+1  A: 

Since one would assume that the display of error information is rare there isn't a lot of difference between the approaches. You should go with the simplest and easiest to understand solution. That would likely be using the collapsed error XAML

AnthonyWJones