CustomMultipleDropDownBox
发布日期:2021-09-05 00:32:53 浏览次数:27 分类:技术文章

本文共 3844 字,大约阅读时间需要 12 分钟。

View Code
-->
View Code
// Copyright (c)All Right Reserved by Melco// All other rights reserved.// 
Infosys
//
2013/03/08
// Melco Crown Project Patron Management Module Class Fileusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Collections;namespace GEMS.Windows.Controls.CustomControls{ public class CustomMultipleDropDownBox : ComboBox { #region Property protected ListBox MyListBox { get { return base.GetTemplateChild("MyListBox") as ListBox; } } protected ListBox MySelectedListBox { get { return base.GetTemplateChild("MySelectedListBox") as ListBox; } } //public IList SelectedItems //{ // get { return (IList)GetValue(SelectedItemsProperty); } // set { SetValue(SelectedItemsProperty, value); } //} //// Using a DependencyProperty as the backing store for SelectedItems. This enables animation, styling, binding, etc... //public static readonly DependencyProperty SelectedItemsProperty = // DependencyProperty.Register("SelectedItems", typeof(IList), typeof(CustomMultipleDropDownBox), new PropertyMetadata(null)); #endregion #region construtor static CustomMultipleDropDownBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomMultipleDropDownBox), new FrameworkPropertyMetadata(typeof(CustomMultipleDropDownBox))); } public CustomMultipleDropDownBox() { } public override void OnApplyTemplate() { base.OnApplyTemplate(); //load the text box control if (this.MyListBox != null) { this.MyListBox.SelectionChanged += MyListBox_SelectionChanged; } if (this.MySelectedListBox!=null) { } } protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { base.OnItemsChanged(e); } protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue) { base.OnItemsSourceChanged(oldValue, newValue); } #endregion #region Event void MyListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { this.MySelectedListBox.ItemsSource = this.MyListBox.SelectedItems; } #endregion }}

 

转载于:https://www.cnblogs.com/FaDeKongJian/archive/2013/04/27/3047632.html

转载地址:https://blog.csdn.net/weixin_34228387/article/details/93216647 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:使用CefSharp跳转页面不弹出页面:
下一篇:BZOJ 1026 windy数

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年03月30日 12时58分59秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

Spring注解驱动开发第48讲——Spring IOC容器创建源码解析(八)之完成BeanFactory的初始化创建工作,最终完成容器创建 2019-04-27
Spring注解驱动开发第49讲——Spring IOC容器创建源码解析(九)之Spring IOC容器创建源码总结 2019-04-27
IntelliJ IDEA快速入门 | 第一篇:你不会还不知道IntelliJ IDEA吧!不要太low哦! 2019-04-27
Spring Boot 2从入门到入坟 | 底层注解篇:@ConfigurationProperties配置绑定 2019-04-27
Spring Boot 2从入门到入坟 | 自动配置篇:源码分析之自动包规则原理 2019-04-27
Spring Boot 2从入门到入坟 | 自动配置篇:源码分析之初始加载自动配置类 2019-04-27
Spring Boot 2从入门到入坟 | 最佳实践篇:Spring Boot应用该如何编写? 2019-04-27
Spring Boot 2从入门到入坟 | 最佳实践篇:使用Lombok插件来简化JavaBean的开发 2019-04-27
Spring Boot 2从入门到入坟 | 最佳实践篇:devtools开发者工具的简单使用 2019-04-27
Spring Boot 2从入门到入坟 | 最佳实践篇:Spring Initailizr的使用 2019-04-27
Spring Boot 2从入门到入坟 | 配置文件篇:yaml语法详解 2019-04-27
Eclipse环境下如何配置Tomcat,并且把项目部署到Tomcat服务器上 2019-04-27
如何将Eclipse中的Web项目自动部署到Tomcat? 2019-04-27
Java Web基础入门第八讲 Java Web开发入门——初始WEB服务器 2019-04-27
Java集合框架——Map 2019-04-27
常用API(一)——String、StringBuffer与基本类型包装类 2019-04-27
第三章——构建模块 2019-04-27
复习反射 2019-04-27
我终于有了一个GitHub了 2019-04-27
Win10上安装VMware虚拟软件 2019-04-27