我在WPF中使用 BooleanToVisibilityConverter
绑定可见性控制的
属性设置为布尔
。这工作得很好,但我想其中一个控件隐藏如果布尔是真
,并显示它是否假
。
I'm using a BooleanToVisibilityConverter
in WPF to bind the Visibility
property of a control to a Boolean
. This works fine, but I'd like one of the controls to hide if the boolean is true
, and show if it's false
.
实现你自己的实现的IValueConverter的。示例实现是
Implement your own implementation of IValueConverter. A sample implementation is at
的http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter.aspx
在您的转换方法,使其返回的值,你想,而不是缺省值。
In your Convert method, have it return the values you'd like instead of the defaults.
上一篇:如何检测在运行时.NET 4.5版目前正在运行的code?正在运行、目前、NET、code
下一篇:什么是Application.ThreadException和AppDomain.CurrentDomain.UnhandledException之间的区别?区别、ThreadException、Ap