-
大小: 125KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-06-06
- 语言: 其他
- 标签: CheckBox ComboBox...
资源简介
带CheckBox功能的ComboBox,可以在下拉框中选择多个CheckBox选项。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.objectModel;
using System.ComponentModel;
namespace MultiSelectComboBox
{
///
/// Interaction logic for MultiSelectComboBox.xaml
///
public partial class MultiSelectComboBox : UserControl
{
private ObservableCollection _nodeList;
public MultiSelectComboBox()
{
InitializeComponent();
_nodeList = new ObservableCollection();
}
#region Dependency Properties
public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register(“ItemsSource“ typeof(Dictionaryject>) typeof(MultiSelectComboBox) new frameworkPropertymetadata(null
new PropertyChangedCallback(MultiSelectComboBox.OnItemsSourceChanged)));
public static readonly DependencyProperty SelectedItemsProperty =
DependencyProperty.Register(“SelectedItems“ typeof(Dictionaryject>) typeof(MultiSelectComboBox) new frameworkPropertymetadata(null
new PropertyChangedCallback(MultiSelectComboBox.onselectedItemsChanged)));
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register(“Text“ typeof(string) typeof(MultiSelectComboBox) new UIPropertymetadata(string.Empty));
public static readonly DependencyProperty DefaultTextProperty =
DependencyProperty.Register(“DefaultText“ typeof(string) typeof(MultiSelectComboBox) new UIPropertymetadata(string.Empty));
public Dictionaryject> ItemsSource
{
get { return (Dictionaryject>)GetValue(ItemsSourceProperty); }
set
{
SetValue(ItemsSourceProperty value);
}
}
public Dictionaryject> SelectedItems
{
get { return (Dictionaryject>)GetValue(SelectedItemsProperty); }
set
{
SetValue(SelectedItemsProperty value);
}
}
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty value); }
}
public string DefaultText
{
get { return (string)GetValue(DefaultTextProperty); }
set { SetValue(DefaultTextProperty value); }
}
#endregion
#region Events
private static void OnItemsSourceChanged(Dependencyobject d DependencyPropertyChangedEventArgs e)
{
M
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2602 2013-03-19 09:47 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox.sln
文件 40960 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox.v11.suo
目录 0 2013-07-23 17:31 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\
目录 0 2013-07-23 17:31 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\bin\
目录 0 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\bin\Debug\
文件 16896 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\bin\Debug\MultiSelectComboBox.dll
文件 34304 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\bin\Debug\MultiSelectComboBox.pdb
文件 3978 2013-03-19 09:47 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\MultiSelectComboBox.csproj
文件 5168 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\MultiSelectComboBox.xaml
文件 8239 2013-07-23 17:32 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\MultiSelectComboBox.xaml.cs
目录 0 2013-07-23 17:31 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\
目录 0 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\
文件 7406 2013-07-23 17:31 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 3317 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox.baml
文件 1709 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox.csproj.FileListAbsolute.txt
文件 917 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox.csproj.GenerateResource.Cache
文件 16896 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox.dll
文件 4775 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox.g.cs
文件 4775 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox.g.i.cs
文件 3563 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox.g.resources
文件 34304 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox.pdb
文件 180 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox.Properties.Resources.resources
文件 317 2013-07-23 17:33 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox_MarkupCompile.cache
文件 317 2013-07-23 17:31 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\MultiSelectComboBox_MarkupCompile.i.cache
目录 0 2013-03-17 18:19 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\obj\Debug\TempPE\
目录 0 2013-07-23 17:31 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\Properties\
文件 2320 2013-03-19 09:47 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\Properties\AssemblyInfo.cs
文件 2864 2013-03-19 09:47 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\Properties\Resources.Designer.cs
文件 5612 2013-03-19 09:47 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\Properties\Resources.resx
文件 1102 2013-03-19 09:47 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\Properties\Settings.Designer.cs
文件 201 2013-03-19 09:47 MultiSelectComboBox Demo(Codebehind)\MultiSelectComboBox\Properties\Settings.settings
............此处省略39个文件信息
评论
共有 条评论