SL3 数据表单验证指示器不显示在选项卡页面中

发布于 2024-08-16 04:22:03 字数 194 浏览 1 评论 0原文

我有一个带有选项卡控件的 Prism/SL3 应用程序,选项卡控件的每个页面都是一个具有自己的视图和 viewModel 的“区域”。当我想验证主页时,我调用 dataForm.ValidateItem(),然后转到所有子视图并执行相同的操作。问题是,只有用户单击它们的页面(在选项卡页上)才会被实例化,而从未显示的页面不会实例化其视图,因此我无法验证它们。 有什么帮助吗?

I have a Prism/SL3 application with a tab control and each page of the tab control is a "Region" that has its own view and viewModel. when I want to validate the main page, I call dataForm.ValidateItem(), then I go to all the child views and do the same. the problem is, only the pages which user has clicked on them (on the tab page), get instantiated and the pages that are never shown, don't have their view instantiated, thus I can't validate them.
any help?

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

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

发布评论

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

评论(1

愚人国度 2024-08-23 04:22:03

我为此创建了一个伪解决方案。这很hacky,但确实有效。我的示例涉及遍历可视化树(向上和向下)以查找无效的相应控件,然后“展开”所选项目。我在示例中使用了手风琴,但也使用选项卡对此进行了测试:
http://thoughtjelly.wordpress.com/2009/09/24/walking-the-xaml-visualtree-to-find-a-parent-of-type-t/

HTH,
标记

编辑:链接已更新。

I created a psuedo work around for this. It's very hacky, but it does work. My example involved walking the visual tree (up and down) to find respective controls that are invalid and then "expanding" the selected item. I have used an accordian in my example, but have also tested this with tab:
http://thoughtjelly.wordpress.com/2009/09/24/walking-the-xaml-visualtree-to-find-a-parent-of-type-t/

HTH,
Mark

EDIT: Link updated.

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