關(guān)于
可以通過(guò) Snoop 查看 WPF 程序的 Visual Tree,更多介紹請(qǐng)看 snoopwpf
快速開(kāi)始
一、下載 snoopwpf.msi
安裝后打開(kāi),選擇自己的程序,點(diǎn)擊 snoop(望遠(yuǎn)鏡)
二、篩選
點(diǎn)擊左側(cè)下拉列表,選擇 Show only elements with binding errors
三、點(diǎn)擊出錯(cuò)的節(jié)點(diǎn),右側(cè)點(diǎn)擊 Properties,然后滾動(dòng)表格,找到標(biāo)紅的一行
四、右鍵選擇 Display Binding Errors
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-667787.html
五、分析錯(cuò)誤文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-667787.html
System.Windows.Data Error: 23 : Cannot convert '<null>' from type '<null>' to type 'System.Double' for 'en-US' culture with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException: DoubleConverter 無(wú)法從 (null) 轉(zhuǎn)換。
在 System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
在 System.ComponentModel.TypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
在 System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
在 MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)'
System.Windows.Data Error: 6 : 'ObjectSourceConverter' converter failed to convert value '<null>' (type '<null>'); fallback value will be used, if available. BindingExpression:Path=Tag; DataItem='ProgressBar' (Name=''); target element is 'Rectangle' (Name=''); target property is 'RadiusX' (type 'Double') NotSupportedException:'System.NotSupportedException: DoubleConverter 無(wú)法從 (null) 轉(zhuǎn)換。
在 MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)
在 MS.Internal.Data.ObjectSourceConverter.Convert(Object o, Type type, Object parameter, CultureInfo culture)
在 System.Windows.Data.BindingExpression.ConvertHelper(IValueConverter converter, Object value, Type targetType, Object parameter, CultureInfo culture)'
到了這里,關(guān)于WPF 查看綁定錯(cuò)誤——Snoop 的基本使用的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!