设计具有可见性的控件绑定到折叠 [英] Designing controls with Visibility bound to Collapsed
问题描述
我正在使用Blend来设计一个窗口,该窗口包含一些控件,这些控件只应在事件发生时显示。我正在使用MVVM,我的VM有一个布尔属性(即HasSomethingHappened),默认情况下为false。这与控件的可见性(使用BooleanToVisibilityConverter)绑定,这使得控件折叠。
有没有一种方法可以使用blend来查看控件是设计模式而不删除我的绑定和设计到位后添加它们了什么?
谢谢,
香农
Hi,
I'm using Blend to design a window that hosts a few controls that should only be displayed once an event as happened. I'm using MVVM and my VM has a boolean property (ie, HasSomethingHappened) which is false by default. This is bound to the visibility of the control (using a BooleanToVisibilityConverter) which is making the control collapsed.
Is there a way that I can use blend to view the control is design mode without removing my bindings and adding them once the design is in place?
Thanks,
Shannon
推荐答案
我通常会建立我的所有设计具有默认visibilty的可折叠控件,所以我可以看到我在Blend中正在做什么,然后我添加了一个在运行时折叠所有内容的Page.Loaded事件。如果您正在构建具有大量折叠/扩展区域的菜单,那将是一个巨大的帮助。
I usually build all of my collapsable controls with the default visibilty so I can see what I'm doing in Blend, then I add a Page.Loaded event that collapses everything at runtime. It's a huge help if you're building menus and whatnot that have lots of collapsing/expanding areas.
这篇关于设计具有可见性的控件绑定到折叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!