WPF and Silverlight.ComboBox 如何通过 Binding IsDropDownOpen 实现下拉菜单展开
2013-09-24 15:55
387 查看
IntheWPFexamplethePopupandtheToggleButton(thearrowontheright)areboundwiththepropertyIsDropDownOpen:
在模版里面设置
Aclass
Silverlighthasnobindingsinxaml,butyouwillfindthesamesequenceifyouopentheassemblyin.NetReflector.
在模版里面设置
<PopupIsOpen="{TemplateBindingIsDropDownOpen}"... <ToggleButtonIsChecked="{BindingPath=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSourceTemplatedParent}}"...
Aclass
Popuphastheproperty
StaysOpenthatisn'tspecifiedinthestandardtemplateofaComboBoxandhasadefaultvalue
true.Itfollowsthatthereisasubscriptiontothe
LostFocuseventintheinternalimplementationofaComboBox,thatsets
IsDropDownOpen=falseeverytimewhenthecontrolloseafocus.
Silverlighthasnobindingsinxaml,butyouwillfindthesamesequenceifyouopentheassemblyin.NetReflector.
相关文章推荐
- Silverlight学习笔记四:如何通过自定义ComboBox实现SelectedValue
- Flex中如何通过给ComboBox创建自定义的项提供源,使其下拉菜单显示复数项目。
- WPF and Silverlight 学习笔记(二十二):使用代码实现绑定、绑定数据的验证
- WPF开发中遇到的问题及解决系列(二):如何获取通过binding生成的ComboBox或者ListBox等的Item
- 如何实现 TreeView Items 全部展开和全部收缩(WPF)
- WPF and Silverlight 学习笔记(二十二):使用代码实现绑定、绑定数据的验证
- 如何实现 TreeView Items 全部展开和全部收缩(WPF)
- WPF and Silverlight 学习笔记(二十二):使用代码实现绑定、绑定数据的验证
- WPF and Silverlight 学习笔记(二十五):使用CollectionView实现对绑定数据的排序、筛选、分组
- [转]WPF and Silverlight 学习笔记(二十五):使用CollectionView实现对绑定数据的排序、筛选、分组
- WPF and Silverlight 学习笔记(二十五):使用CollectionView实现对绑定数据的排序、筛选、分组
- [WPF/Silverlight]INotifyPropertyChanged的实现如何更优雅
- WPF and Silverlight 学习笔记(二):WPF和Silverlight概述
- 如何通过HTML标记或JS代码实现跳转返回页面顶部
- 如何通过OpenFace实现人脸识别框架
- 如何实现具有层次结构的 TreeView <三> (WPF/TreeView/Style/Template)
- 如何通过存储过程实现记录集的循环
- WPF中comboBox组件如何绑定里面有Description的枚举
- .net数据持久化封装 -如何通过修改IL代码实现
- 如何实现一个不规则形状的WPF窗口