摘要: 首先,先要创建一个wpf的自定义控件类MyComboboxTree然后继承修改为Combobox,当然也可以继承control,不过ComboboxTree可以复用Combobox很多属性。接着添加一个依赖属性,MyItemsSource用来给tree绑定。代码如下:[TemplatePart(Name = "tree", Type = typeof(TreeView))] [TemplatePart(Name = "PART_Popup", Type = typeof(Popup))] [TemplatePart(Name = "PART_T 阅读全文
posted @ 2014-02-12 15:59 gavin.huang 阅读(3711) 评论(4) 推荐(0) 编辑
摘要: 常用的TextBlock使用如下: TextBlock is designed to be lightweight, and is geared specifically at integrating small portions of flow content into a UI.Click Me By default, a TextBlock provides no UI beyond simply displaying its contents.Click Me显示如下:但是当碰到这种需求:一个字符窜,分三段组成,第一段一种字体,常量,第二段一种字体,并且需要绑定变量,第三段又是... 阅读全文
posted @ 2014-02-12 15:44 gavin.huang 阅读(285) 评论(0) 推荐(0) 编辑
摘要: TreeViewItem Msdn定义:TreeViewItem 是一个 HeaderedItemsControl,这意味着其标头和对象的集合可以是任何类型(如字符串、图像或面板)。有关更多信息,请参见 HeaderedItemsControl 类。TreeViewItem 控件可嵌入在其他 TreeViewItem 控件内,以在 TreeView 控件内创建一个节点层次结构。若要展开或折叠 TreeViewItem,请使用 IsExpanded 属性。有关 TreeView 控件的更多信息,请参见 TreeView 概述。自定义 TreeViewItem 控件若要对多个 TreeViewIt 阅读全文
posted @ 2014-02-12 15:23 gavin.huang 阅读(941) 评论(0) 推荐(0) 编辑