是否可以在Silverlight消息框中显示异常 [英] Is it possible to show the Exception in Silverlight Message box

查看:75
本文介绍了是否可以在Silverlight消息框中显示异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Silverlight消息框中显示异常。如果有人知道请给出答案。在此先感谢。

Is it possible to show the Exception in Silverlight Message box. If any one knows please give answer. Thanks in advance.

推荐答案

看看这里:

Silverlight开发人员简单但可呈现的消息框 [ ^ ]

http://stackoverflow.com/questions/2758026/yes-无银取消确认 [ ^ ]

在Silverlight中创建自己的MessageBox [ ^ ]

创建一个Silverlight消息框 [ ^ ]
Have a look here:
Simple but presentable message boxes for Silverlight developers[^]
http://stackoverflow.com/questions/2758026/yes-no-cancel-confirmation-in-silverlight[^]
Creating your own MessageBox in Silverlight[^]
Create a Silverlight Message Box[^]


使用下面的代码在消息框中显示错误



Use below code to show Error in message box

public partial class ErrorWindow : ChildWindow
    {
        public ErrorWindow(Exception e)
        {
            InitializeComponent();
            if (e != null)
            {
                ErrorTextBox.Text = e.Message + Environment.NewLine + Environment.NewLine + e.StackTrace;
            }
        }
     }


您可以使用app.xaml.cs文件中的Unhandled_Exception事件来实现这一点。 />
由于所有未处理的silverlight异常都可以在此处捕获。
You can achieve that using Unhandled_Exception event in app.xaml.cs file.
As all the unhandled silverlight exceptions can be caught here.


这篇关于是否可以在Silverlight消息框中显示异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆