11 2009 档案
摘要:1. 数据绑定(Binding)一般配置 常用的绑定的目标(Dependency Object & associated Dependency Property,目标单元): 内容控件目标:object ContentControl.Content 集合控件目标:IEnumerable ItemsControl.ItemSource 绑定器: Binding ( : BindingBase : MarkupExtension ) Binding binding = new Binding(); binding.ElementName = "WPF控件名称"; / b
阅读全文
摘要:1. 资源和Pack URI体系 MSDN上比较完整的介绍: http://msdn.microsoft.com/en-us/library/aa970069.aspx 使用Pack URI的资源必须以Build Action为Resource(不是工程属性中资源列表里的Embedded Resource,其机制更复杂)加入WPF工程,嵌入程序二进制文件中的资源更新时要重新生成工程。 Pack URI基本格式:pack://<authority>/<path> 其中授权方<authority>对应一个包(package),路径<path>对应一个
阅读全文
摘要:1. 画刷 1.1 渐变画刷(Gradient Brushes) 主要包括线性渐变和辐射渐变,两者都作用在一个矩形填色区域上,用[0,1]×[0,1]覆盖。 线性渐变(LinearGradientBrush ):StartPoint和EndPoint用来指定渐变路径(直线),等色线与渐变路径垂直。用GradientStop单元定义渐变路径上的点,其Color属性为这个点上颜色,Offset属性为0到1,表示经过渐变路径的比例。第一个GradientStop之前和最后一个之后渐变路径上的点的颜色分别为这两个点的颜色。当沿渐变路径填色没有覆盖整个区域时,剩余区域的填色方法由LinearG
阅读全文
摘要:1. WPF控件概览控件类型关键基类实例类型说明孤立控件(Individual Control)ContentControlContent属性,对应一个object,如该元素不继承UIElement,则显示其ToString()字符串内容Label助记键(Mnemonic Keys):在字符前加_对应Alt+该字符,并用Target=”{Binding ElementName=???}”绑定聚焦对象Button快速访问(Access Keys):在字符前加_对应Alt+该字符 IsDefault="True"对应Enter键 IsCancel="True"
阅读全文
摘要:It is test on writing and publishing this live space with Windows Live Writer. It looks cool and functions well*, but it would be better if it were fully accommodated to all the features the Live provides and/or were integrated with the equally smart Live Mail which has almost made me abandon fox...
阅读全文
摘要:1. Journal 的使用Journal 用于在 XAML 浏览器应用程序(XBAP)中维护历史访问页。删除前一访问页只需调当前 NavigationService 对象的 RemoveBackEntry() 即可;而增加一个访问页则复杂得多:1) 实现一个 CustomContentState 的派生类,每个对象对应一个要保存的访问页,其中数据结构用于维护这个历史访问页的数据,在构造的时候通过适当的参数传入。它必须标上 Serializable() 属性。在这个类里要重载一个 Replay 方法和一个 JournalEntryName。Replay 一般通过向构造时传入的页面回调提供数据,
阅读全文
摘要:Object monitor plays a leading role in thread synchronization. Apart from its Enter and Exit methods (equivalent to opening and closing bracket pairafter the lock keywordspecifying synchronized codeblock), it offers two additional methods which are required to augment its synchronization functionali
阅读全文