SL3 数据表单验证指示器不显示在选项卡页面中
我有一个带有选项卡控件的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我为此创建了一个伪解决方案。这很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.