心如止水

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2009年3月3日

摘要: GetWindowRect() 得到的是在屏幕坐标系下的RECT(即以屏幕左上角为原点) GetClientRect() 得到的是在客户区坐标系下的RECT(即以所在窗口,去掉了标题栏,左右下边框等之后的左上角为原点,仅仅是个大小,返回值的左上角永远为0,0) ScreenToClient() 就是把屏幕坐标系下的RECT坐标转换为客户区坐标系下的RECT坐标。 ClientToScreen反... 阅读全文
posted @ 2009-03-03 16:28 cutebear 阅读(2549) 评论(0) 推荐(0) 编辑

2009年2月26日

摘要: 原文地址:http://blogs.interknowlogy.com/johnbowen/archive/2007/08/27/21132.aspxThe flexibility of the WPF ItemsControls allows you build column-row views of lists of data by building templates to represen... 阅读全文
posted @ 2009-02-26 11:19 cutebear 阅读(1189) 评论(0) 推荐(0) 编辑

2009年2月12日

摘要: WPF全球化和本地化步骤: 本文介绍使用二进制xaml(baml)的方法来本地化,下面通过一个"运行"对话框的实例来说明: 在项目文件(.csproj)中,开发人员设置 en-US,这样当编译应用程序时,在bin\debug目录下就会生成一个en-US的文件夹,在它里面有一个RunDialog.resources.dll 文件,该文件包含所有可本地化的资源。生成的这个叫做主程序集,我们选择... 阅读全文
posted @ 2009-02-12 17:58 cutebear 阅读(1856) 评论(0) 推荐(0) 编辑

2009年2月10日

摘要: GetHashCode注意点: GetHashCode 方法的默认实现不保证针对不同的对象返回唯一值。而且,.NET Framework 不保证 GetHashCode 方法的默认实现以及它所返回的值在不同版本的 .NET Framework 中是相同的。因此,在进行哈希运算时,该方法的默认实现不得用作唯一对象标识符。 GetHashCode 方法可以由派生类型重写。值类型必须重写此方法,以... 阅读全文
posted @ 2009-02-10 10:56 cutebear 阅读(2960) 评论(0) 推荐(0) 编辑

2009年1月5日

摘要: IEnumerator:提供在普通集合中遍历的接口,有Current,MoveNext(),Reset(),其中Current返回的是object类型。IEnumerable: 暴露一个IEnumerator,支持在普通集合中的遍历。IEnumerator:继承自IEnumerator,有Current属性,返回的是T类型。IEnumerable:继承自IEnumerable,暴露一个IEnume... 阅读全文
posted @ 2009-01-05 16:36 cutebear 阅读(2580) 评论(5) 推荐(2) 编辑

2008年12月26日

摘要: 1. http://j832.com/bagotricks/ 这里有许多的自定义控件的实现,如ColorPicker,NumericUpDown,Zap Scroller,InforTextBox等等。2008/03/08版本下载,另外在这个博客上也有类似的WPF controls,http://www.cnblogs.com/zhouyinhui/archive/2007/05/24/75882... 阅读全文
posted @ 2008-12-26 13:35 cutebear 阅读(2324) 评论(0) 推荐(0) 编辑

摘要: 参考自:http://www.cnblogs.com/zhouyinhui/archive/2007/12/01/979715.html 1. User Control和Custom Control 在新建一个Project的时候,WPF提供了2种自定义控件的模板:WPF User Control Library和WPF Custom Control Library。User Control... 阅读全文
posted @ 2008-12-26 10:02 cutebear 阅读(2880) 评论(3) 推荐(2) 编辑

2008年12月2日

摘要: 原文:http://blogs.msdn.com/vinsibal/archive/2008/08/11/wpf-3-5-sp1-feature-bindinggroups-with-item-level-validation.aspx Motivation Before 3.5 SP1, the binding validation system worked with only one bin... 阅读全文
posted @ 2008-12-02 15:39 cutebear 阅读(728) 评论(0) 推荐(0) 编辑

摘要: 原文:http://blogs.msdn.com/vinsibal/archive/2008/05/14/recycling-that-item-container.aspx Recycling that Item Container Item container recycling isa one of the many new features in SP1. I'm going to talk a little bit about it here. What is it? As a little background, the VirtualizingStackPanel' 阅读全文
posted @ 2008-12-02 12:03 cutebear 阅读(1856) 评论(0) 推荐(0) 编辑

2008年12月1日

摘要: 原文地址:http://blogs.msdn.com/vinsibal/archive/2008/05/22/wpf-3-5-sp1-feature-non-live-scrolling.aspx What is it? Before 3.5 SP1, the WPF ScrollViewer only supported live scrolling, which means the view ... 阅读全文
posted @ 2008-12-01 14:33 cutebear 阅读(649) 评论(0) 推荐(0) 编辑

2008年11月28日

摘要: Background Formatting data can be a pretty cumbersome task in WPF. To illustrate with a very simple example, let's say I want to display the dollar value of some item in a TextBlock: ... 阅读全文
posted @ 2008-11-28 15:35 cutebear 阅读(806) 评论(0) 推荐(0) 编辑

2008年11月27日

摘要: 本文讲述了对一个ItemsControl中的Items如何实现多个层次的Group。要注意的几个地方是: 1. ItemContainerStyle 这是为每一个Item的container设置的style,例如对于ListBox,这个container就是ListBoxItem。 另外还有一个ItemContainerStyleSelector属性,通过它可以根据自己的需要... 阅读全文
posted @ 2008-11-27 13:47 cutebear 阅读(244) 评论(0) 推荐(0) 编辑

2008年11月26日

摘要: 原文地址:http://blogs.msdn.com/wpfsdk/archive/2007/10/02/data-validation-in-3-5.aspx 本文讲述了3.5中新增的用IdataErrorInfo来实现数据验证,以及与3.0中通过重载ValidationRule来实现验证的区别和相同点。 Data Validation in 3.5 A cool new feature ... 阅读全文
posted @ 2008-11-26 15:06 cutebear 阅读(619) 评论(0) 推荐(0) 编辑

2008年11月18日

摘要: Agile Developer, Inc. 1 of 9 http://www.agiledeveloper.com Venkat Subramaniam venkats@agiledeveloper.com http://www.agiledeveloper.com/download.aspx 本链接提供了很多下载。Background Worker in .NET 2.0 Abstr... 阅读全文
posted @ 2008-11-18 15:22 cutebear 阅读(340) 评论(0) 推荐(0) 编辑

2008年11月10日

摘要: Extension Method能够让你为一个已经存在的类添加方法,而不用去创建一个子类继承它。 具体做法: 定义一个静态的类来包含这个扩展方法。 定义扩展方法,必须是静态的,该方法的第一个参数用来指定是扩展哪个类的方法, 并且前面要加this关键字。 在想要调用扩展方法的类中,用using引入该类的命名空间就可以了。 下面是例子: 定义一个类来扩展string类: names... 阅读全文
posted @ 2008-11-10 14:45 cutebear 阅读(610) 评论(0) 推荐(0) 编辑