用户是否有任何方法可以使折叠的控件在 WPF 应用程序中可见?
如果您只想在同一版本中为某些用户折叠控件,那么如果这些控件对其他用户而言是折叠的,那么包含这些控件是否安全?
UDPATE:查看答案,但是如果在您的应用程序中,您在控件和它调用的操作之间有一些代理,即无论您的控件是否可见,操作都无法执行,那么您需要别担心。 您应该拥有这个!就像在网站上一样,您不应该假设执行某个操作就意味着您可以!
Would it be safe to include controls you only want for certain users in the same build if they are collapsed for other users?
UDPATE: See answer, however if in you app you have some broker between the control and the action it invokes, i.e. regardless of whether you control can be seen or not the action cannot be performed, then you needn't worry. You should have this! Just like with a website you should not assume peforming an action means you can!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想隐藏功能或敏感数据,那么仅在 UI 的可见性上设置折叠是不够的。有人可以使用 Snoop 或类似工具,然后只需将可见性更改为可见即可。
最好的选择是根本不将控件添加到可视化树中。
我还想补充一点,不将目前不需要的控件添加到可视化树中也是一个好主意,因为即使控件折叠起来,它仍然会被创建并执行数据绑定。
If you want to hide features or sensitive data then just setting Collapsed on the Visibility of the UI is not enough. Someone could use Snoop or similar tools and then simply change the Visibility to Visible.
Your best bet is to not add the control to the visual tree at all.
I also want to add that not adding controls to the visual tree that you don't need at the moment is a good idea performance wise too as even if the control is collapsed it will still be created and perform data binding.
嘿,这就是你要找的东西吗?
http://aappddeevv.blogspot.com/2008/11 /wpf-visibility-and-hiding-controls.html
hey, is this something like what you're looking for?
http://aappddeevv.blogspot.com/2008/11/wpf-visibility-and-hiding-controls.html