如何通过复选框设置样式/资格? [英] How to Set the Style/Aligment by a CheckBox?
本文介绍了如何通过复选框设置样式/资格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以通过XAML代码中的复选框设置HorizontalAlignment和VerticalAlignment.
示例:
我有一个CheckBox和一个Image.如果CheckBox被选中,那么我的IMAGE HorizontalAlignment = Left和VerticalAlignment = Top.
但是如何???
THX !!!!
Hi,
it is possible to set the HorizontalAlignment & VerticalAlignment by a CheckBox in the XAML-Code???
Example:
I hava one CheckBox and one Image. If the CheckBox isChecked, then is my IMAGE HorizontalAlignment = Left and the VerticalAlignment = Top.
But How???
THX!!!!
推荐答案
在正常情况下,您只能将匹配类型绑定在一起,但通过使用converters
,您可以将任何内容绑定到其他任何东西!
要了解有关转换器的更多信息:
http://blogs.msdn.com/b/bencon/archive/2006/05/10/594886.aspx [ ^ ]
http://www.wpftutorial.net/ValueConverters.html [ http://www.dev102.com/2008/07/17/wpf -binding-converter-best-practices/ [
In normal cases you can only bind matching types together but by usingconverters
you can bind anything to any other thing !
To learn more about converters :
http://blogs.msdn.com/b/bencon/archive/2006/05/10/594886.aspx[^]
http://www.wpftutorial.net/ValueConverters.html[^]
http://www.dev102.com/2008/07/17/wpf-binding-converter-best-practices/[^]
I hope that you get the point ;)
这篇关于如何通过复选框设置样式/资格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文