如何使用Application Insights记录Windows 10 UWP应用中的数据绑定异常? [英] How to log data binding exceptions in Windows 10 UWP apps using Application Insights?

查看:71
本文介绍了如何使用Application Insights记录Windows 10 UWP应用中的数据绑定异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确保我知道我的团队是否在我们正在构建的Windows 10 UWP应用程序中引入了数据绑定错误.自WPF诞生之日起,XAML数据绑定错误就无声地失败了(无论好坏).可以使用.NET的强制性方法来绑定数据绑定,但这并不是我想要的,因为我希望能够使用声明性(基于XAML的数据绑定).我正在寻找一种类似于App.xaml.cs中的"UnhandledException"事件的全局挂钩,该事件将允许我调用TelemetryClient.TrackException(...).

I want to ensure that I am aware if my team introduces data binding errors within our Windows 10 UWP apps that we are building. XAML data binding errors have silently failed (for better or for worse) since the beginning days of WPF. There were imperative ways to hook onto data bindings available in .NET but that's not what I'm looking for as I want to be able to use declarative (XAML-based data bindings). I'm looking for a global hook kind of like the "UnhandledException" event in App.xaml.cs that would allow me to call TelemetryClient.TrackException(...).

推荐答案

您可能会使用DebugSettings.BindingFailed event,请参见

You could probably use DebugSettings.BindingFailed event, see https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.debugsettings

这篇关于如何使用Application Insights记录Windows 10 UWP应用中的数据绑定异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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