返回提交历史
Modified
README.zh-CN.md
+6
-1
XFEstudio/XFEExtension.NetCore.WinUIHelper
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
0e9d078
代码差异
1 个文件
+6
-1
@@ -56,11 +56,16 @@ public App()
56
56
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
57
57
{
58
58
// 使用消息服务显示错误
59
if (ServiceManager.GetService<IMessageService>() is IMessageService messageService)
59
try
60
60
{
61
var messageService = ServiceManager.GetService<IMessageService>();
61
62
messageService.ShowMessage(e.Message, "发生错误", InfoBarSeverity.Error);
62
63
e.Handled = true;
63
64
}
65
catch
66
{
67
// IMessageService 未注册时忽略,避免在异常处理流程中再次抛出异常
68
}
64
69
}
65
70
```
66
71