设计具有可见性的控件绑定到折叠

编程入门 行业动态 更新时间:2024-10-18 03:28:18
本文介绍了设计具有可见性的控件绑定到折叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用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.

更多推荐

设计具有可见性的控件绑定到折叠

本文发布于:2023-11-11 05:50:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577557.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定   控件   见性

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!