随笔分类 - WPF
摘要:An issue related to selected item update on changing data bound WPF standard ComboBox item sources I've analysed and fixed.
阅读全文
摘要:QuanbenSoft Windows Runtime (Windows Store)Apps 应用和框架总览
阅读全文
摘要:This article discusses an approach to the issues with the obtention of visual bounds of objects from view/view model side, including
the unavailability of the view/view model and the impact on the functioning of the framework of Plato by violating its guidelines of usage. It introduces a modified sight manager with unified visual information support and how it's integrated with the existing system.
阅读全文
摘要:At work I spent a lot of time trying to get my head around a issue with WPF grid resizing during runtime. I always found the controls don't resize the way I wanted and differently than how those in the exemplary program (MS Office in this case) do.What I intended to do issomething like the recen
阅读全文
摘要:WPF对初学者来说一个比较复杂的概念是它用两个树来组织其元素的。了解一些WPF的同学一般都知道它们分别是逻辑树(Logical Tree)和视觉树(Visual Tree)。而这两者的关系,以及一个界面中元素究竟如何与另一个元素在这两棵树上联系起来却相当复杂,很难一言两语涵盖其规则。而树和WPF中的...
阅读全文
摘要:1. 本地化 文化标识 .NET使用Culture对象描述本地文化环境。文化标识是标准的,参照参考资料1。 中间(Neutral)、特定(Specific)和无关性(Invariant)文化 例如de-AT,de标志德语系中间文化,de-AT标识奥地利地区,则标志具体的特定文化。无关性文化表示软件资源中文化无关的内容。特定文化标识串如"de-AT"可代入CultureInfo构造函数创建一个该对象。 System.Threading.Thread.CurrentThread.CurrentCulture和CurrentUICulture标志当前线程采取的文化对象和界面文化对
阅读全文
摘要:Style和Animation简而言之就是简便(主要基于XAML而非代码)的方式定制变化的动态的界面;而Template则是以简便重用的方式扩展和丰富界面的静态表现。 1. 样式(Style)类 属性: Style BasedOn:样式继承 ResourceDictionary Resources:定义供样式使用的资源 SetterBaseCollection Setters:属性/事件设置器,包含一系列Setter或EventSetter Type TargetType:样式所作用的单元的类型 TriggerCollection Triggers:包含一系列Trigger对象,用来相应属性变
阅读全文
摘要: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"
阅读全文
摘要:1. Journal 的使用Journal 用于在 XAML 浏览器应用程序(XBAP)中维护历史访问页。删除前一访问页只需调当前 NavigationService 对象的 RemoveBackEntry() 即可;而增加一个访问页则复杂得多:1) 实现一个 CustomContentState 的派生类,每个对象对应一个要保存的访问页,其中数据结构用于维护这个历史访问页的数据,在构造的时候通过适当的参数传入。它必须标上 Serializable() 属性。在这个类里要重载一个 Replay 方法和一个 JournalEntryName。Replay 一般通过向构造时传入的页面回调提供数据,
阅读全文

浙公网安备 33010602011771号