Error dialogs strategies

Topics: Prism v2 - Silverlight 3
Sep 29, 2009 at 8:15 AM

Hi,

I wondering if anybody has some advice on implemeting error dialogs in prism ? are there any best practices ?

Thanks

 

Marcus

Sep 29, 2009 at 8:51 PM

Hi Marcus,

Please have a closer look at the PopupWindow object and its implementation in the code you have from the VIPitechEPS project.

Although it has not been fully implemented yet, this can give you an idea how you can implement error dialogs in your system.

I would suggest creating a factory in the Infrastrcture project which will create a window based on your current need (context of the error and its severity). Having a reference to the window in the viewmodel, you can easily inject another view into it or just show an error text. The new view can be obtained from the Unity container (please check the current implementation for it). The window should have other public properties like Title or Icon to make it more flexible. You can also pass delegates to the window which will be invoked when a user closes a window or clicks the OK button, thus every viewmodel will be able to execute its own code. Also,  please remember that you have to implement additional functionality into the Activity control to disable it immediately when an error window is shown.

Let me know if you need more help.

Regards

Artur

 

 

 

Oct 3, 2009 at 10:38 PM

Thanks for the reply Arthur great pointers.