XAML调试 [英] XAML Debugging
本文介绍了XAML调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是XAML和WPF的新手.有什么方法可以调试XAML?
例如,我们在C#的.cs文件中调试代码.
解决方案
Pritesh Aryan写道:有什么方法可以调试XAML?
不能.您无法调试XAML(AFAIK).但是您可以使用技巧来调试数据绑定.
编写一个Converter(CS/VB),并在绑定到控件时使用它.放置一个断点.
更新:
我将其发布为技巧 XAML DataBinding中的调试技巧 [ ^ ]
尽管Venkatesh Mookkan的回答很不错,但另一件事可能很有意义,那就是在初始化过程中向System.Windows.Application.DispatcherUnhandledException添加处理程序.这可能会提供有价值的信息,包括异常的调用堆栈.
问候
Espen Harlinn
I am new to XAML and WPF. Is there any way to Debug XAML?
For example like we debug code in C#''s .cs file.
解决方案
Pritesh Aryan wrote:Is there any way to Debug XAML?
No. You cannot debug XAML (AFAIK). But you can use a trick to Debug Data Binding.
Write a Converter (CS / VB) and use it while binding to the control. Place a break point.
Update:
I have posted it as Trick Debugging Trick in XAML DataBinding[^]
While Venkatesh Mookkan''s has provided a good answer, another thing that probably makes sense is to add a handler to System.Windows.Application.DispatcherUnhandledException during initalization. This may provide valuable information including the callstack of the exception.
Regards
Espen Harlinn
这篇关于XAML调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文