gpt4 book ai didi

debugging - GroupStyle HidesIfEmpty 中是否有错误?

转载 作者:行者123 更新时间:2023-12-01 05:11:39 25 4
gpt4 key购买 nike

我有一个 Windows Phone 8.1 WinRT 应用程序。我正在使用 SemanticZoom + ListView 组合通过 CollectionViewSource 显示分组列表。 当我从所有组中删除所有项目时 (它们是 ObservableCollections)并开始将项目放回这些空组调试器中断并在读取 DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION 的位置显示“agip.*”;这曾经发生过一段时间,但现在由于某种原因我不知道我的应用程序只是退出并且调试停止而没有任何错误消息;这就是为什么我不记得确切的文件名的原因。

我有两个问题:

1)我怎样才能让调试器再次工作,即显示“agip.*”页面而不是静默退出?

2)通过反复试验,我设法通过更改来找出原因<ListView.GroupStyle><GroupStyle HidesIfEmpty="true"<ListView.GroupStyle><GroupStyle HidesIfEmpty="false" .
瞧我的应用程序没有任何问题。这可能是 WinRT 中的错误吗?

PS:我可以通过转换器将组标题可见性绑定(bind)到 .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?



试试这个。打开异常设置窗口:菜单调试 -> 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?



看起来这是一个错误。

您的解决方法

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);
}

这对我有帮助。

关于debugging - GroupStyle HidesIfEmpty 中是否有错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24398252/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com