PageFunction 未处理导致崩溃

发布于 2024-09-16 20:23:25 字数 337 浏览 8 评论 0原文

我有一个 WPF“向导”,其中使用 PageFunction 对象来显示向导中的各个页面。其中几个页面使用对应用程序内其他程序集中的对象的引用,以便用户可以选择他们想要包含在生成的输出中的“包”。在页面函数中,我将保持活动标志设置为 true,以便当用户在向导中按取消或完成时,我可以捕获向导结果和用户选择的相应数据。

问题在于,即使退出创建向导页面的范围,向导页面也永远不会消失,因此,当我尝试从集合中删除向导数据绑定到的引用对象之一时,它会导致向导页面抛出异常。如果不将 KeepAlive 标志设置为 false,我似乎无法找到解决此问题的方法,但这会破坏从向导捕获用户数据的能力。

有什么想法吗?

谢谢!

I have a WPF "wizard" where I am using PageFunction objects to display the various pages in the wizard. Several of these pages use references to objects in other assemblies within the application so the user can select "packages" they want to include in a generated ouput. In the page function, I have the keep alive flag set to true so that when the user presses cancel or finish in the wizard I can capture the wizard results and the corresponding data the user selected.

The problem is that the wizard pages never go away even after the scope in which they were created has been exited, Thus, when I try to remove one of the referenced objects that the wizard was databound to from a collection, it causes the wizard page to throw an exception. I cannot seem to find a way to correct this issue without setting the KeepAlive flag to false, but this breaks the ability to capture the user data from the wizard.

Any ideas?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

望她远 2024-09-23 20:23:25

我有一些非常相似的东西(如果不一样的话)。使用导航窗口和一组用于收集数据的页面功能页面创建的向导。一些 pagefunction 页面甚至是从应用程序文件夹中的程序集提取的,但我从未遇到过这个问题。您能更具体地说明问题吗?您如何尝试删除引用的对象?您可以发布一些代码以便我查看吗?

I have something very similar (if not the same). A wizard created with a navigation window and a set of pagefunction pages to collect data. Some of the pagefunction pages are even pulled from assemblies in the application folder but I have never had this problem. Can you be more specific on the problem? How do you try to remove the referenced objects? Can you post some code so I can look at it?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文