我有两个问题:
1)如何让调试器再次工作,即显示“agip.*”某个页面,而不是只是默默地退出?
2)通过反复试验,我设法通过改变来追查原因
< ListView.GroupStyle>< GroupStyle HidesIfEmpty =“true”
to< ListView.GroupStyle>< GroupStyle HidesIfEmpty =“false”.
瞧我的应用程序没有任何问题.这可能是WinRT中的错误吗?
PS:我可以通过转换器将组头可见性绑定到.items.count来实现HidesIfEmpty行为,因此这不是问题.
解决方法
1) How can I get the debugger work again i.e. to display that “agip.*” something page and not just silently quit?
试试这个.打开Exception设置窗口:菜单Debug – > Windows – >例外设置.检查所有例外类别.
但是,我没有让它工作.它只是打破了未处理的win32exceptions,没有知道它发生在哪里,也没有给出异常的任何细节,即使附加另一个Visual Studio实例来调试devenv.exe进程并处理所有异常.
2) By trial and error I managed to track down the cause of this by changing <ListView.GroupStyle><GroupStyle HidesIfEmpty=”true” to <ListView.GroupStyle><GroupStyle HidesIfEmpty=”false”. And voila my app works without any problems. Could this be a bug in the WinRT?
看起来这是一个bug.
你的解决方法
I can achieve HidesIfEmpty behavIoUr by binding group header visibility to .items.count through a converter so that’s not an issue here.
这种方法在Windows 10上看起来不太好,例如,组头在底部有一个边框.因此隐藏TextBlock不会完全隐藏组头. (也许我做错了什么).
我以不同的方式解决了这个问题.
另一种解决方法
清除分组集合的每个组后,尝试延迟.像这样:
foreach(var group in GroupsCollection) { group.Clear(); await Delay(1); // this is workaround group.Add(newItem); }
这有助于我的情况.