一个“>”导致我调试了1个小时才解决问题
2012-04-02 13:23
323 查看
在XAML里面写了如下的代码:
原因就是: <ListBox x:Name="PART_HINTS" IsSynchronizedWithCurrentItem="False">>(多写了一个大于号!)
结果在设计界面显示:An Unhandled Exception has occured: Click here to reload the designer.
在调试过程中,报:
{"Add value to collection of type 'System.Windows.Controls.ItemCollection' threw an exception."}
Inner Exception: {"Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead."}
<DataTemplate x:Key="DT_HintCategory"> <Expander HorizontalContentAlignment="Stretch" ExpandDirection="Down" Expanded="Expander_Expanded" Header="AAA" IsExpanded="{Binding Path=IsExpanded, Mode=TwoWay}"> <Expander.Content> <ListBox x:Name="PART_HINTS" IsSynchronizedWithCurrentItem="False">> <ListBox.ItemsSource> <PriorityBinding> <Binding Path="HintsSlow" IsAsync="True" /> <Binding Path="HintsFast" IsAsync="False" /> </PriorityBinding> </ListBox.ItemsSource> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Name}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Expander.Content> </Expander> </DataTemplate>
原因就是: <ListBox x:Name="PART_HINTS" IsSynchronizedWithCurrentItem="False">>(多写了一个大于号!)
结果在设计界面显示:An Unhandled Exception has occured: Click here to reload the designer.
在调试过程中,报:
{"Add value to collection of type 'System.Windows.Controls.ItemCollection' threw an exception."}
Inner Exception: {"Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead."}
相关文章推荐
- 一个“>”导致我调试了1个小时才解决问题
- 解决<input type=“file” multiple> 多文件上传问题(可以多次选取文件,也可以一次选取多个文件),而且点击的是一个同一个div
- DB2问题诊断与解决: 一个由于历史文件过大,导致LOAD慢的问题
- 一个问题解决:adb push build.prop后导致手机crash
- 一个js导致的jquery失效问题的解决方法
- 一个由于锁的作用域导致core dump的问题的解决
- 基于avd7181c解决视频输入效果差的问题<二>---疑难调试手记
- Android 调试遇到RSA key导致手机Offline或Unauthorized问题的终极解决方法
- vs2017用F5调试时js,css文件不能加载导致的问题解决
- 多了一个int, 导致成员变量值异常, 定位问题花费15分钟(后来又遇到此bug, 1分钟解决)
- 一个页面中使用多个iframe导致在ie中假死问题的解决方法
- 一个js导致的jquery失效问题的解决方法
- GDB多线程调试基本命令和实现简介以及一个常见问题的解决
- 关于VS调试_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse))的相关问题解决办法
- 使用VS2005 CTP July调试WinForm的一个问题,解决方法与各位分享。
- 倒是在网上有看到显卡没装风尚导致该问题的,最后换了一个带风扇的显卡就解决的:
- 重复insmod 一个ko模块导致的异常问题解决方法
- 一个NFS缓存管理包的bug导致文件系统满的问题和解决方法
- [置顶] linux系统tomcat应为被定时任务脚本监控自动部署,服务器重启导致同一个tomcat出现很多进程,kill -9杀死又出现等一系列问题解决。
- 一个共享库的问题导致sqlplus用不了了的解决办法!