摘要: 需要用到code behind注意要给需要访问的元素命名x:Name="PART_TextBlock" custom control的程序部分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;us 阅读全文
posted @ 2013-08-16 14:39 若愚Shawn 阅读(482) 评论(0) 推荐(0) 编辑
摘要: TemplateBinding:TemplateBinding是一个Markup Extension1: 不适用在frezable property、controltemplate trigger、 two way binding、 value converter、only support Dependent Property。其实TemplateBinding是下面Text Binding的short cut。TemplateBinding有limitation,只能1way binding 到使用ControlTemplate的 Parent Control2:如果需要2way bindi 阅读全文
posted @ 2013-08-16 13:09 若愚Shawn 阅读(443) 评论(0) 推荐(0) 编辑
摘要: UserControlUserControl实际上就是ContentControl,xaml里tag之间包含的实际就是后台程序的UserControl.Content属性所付的值。如下UserControl.Content包含一个Grid,里面有TextBox和Button.所以可以run time改变usercontrol包含的内容。1:什么时候用UserControl:UserControl是多个已存在control组成的,为复用做准备(比如一个Context Form包含很多基础input,combobox textblock等,之后多次复用)不需要复杂的customzation的时候, 阅读全文
posted @ 2013-08-16 09:18 若愚Shawn 阅读(731) 评论(0) 推荐(0) 编辑