10 2008 档案

WPF 异步编程
摘要:DispatherObject很多wpf 对象有线程相关性(thread affinity),意味在你只能在创建它的线程上使用它。这和window form的UI控件一样。 WinForm的control.invoke() ,winform.timer 会在进行UI操作时做一个线程切换。在wpf中,... 阅读全文

posted @ 2008-10-30 00:59 oyl 阅读(1480) 评论(0) 推荐(0)

WPF 调试方法, WPF Debug
摘要:WPF debug:一.Output window 输出:System.Windows.Data Error: 35 : BindingExpression path error: 'Full' property not found on 'object' ''FileInfo' (HashCode... 阅读全文

posted @ 2008-10-29 12:36 oyl 阅读(3349) 评论(0) 推荐(0)

.net反射解析dll时 关联dll的加载
摘要:问题:一个解析器:using System;using System.Reflection;using System.Collections.Generic;using System.Text;classProgram{ staticvoid Main(string[] args) { string... 阅读全文

posted @ 2008-10-28 13:07 oyl 阅读(1140) 评论(0) 推荐(0)

wcf 跟踪和消息日志记录 :http://msdn.microsoft.com/zh-cn/library/ms751526.aspx
摘要:启用跟踪和消息日志记录。生成的跟踪和消息日志可以使用service tracer viewer查看:在 WCF 中,可通过设置服务模型跟踪源 switchValue 并将下面的代码添加到服务或客户端的配置文件中来实现此目的: 复制代码 ... 阅读全文

posted @ 2008-10-21 20:18 oyl 阅读(445) 评论(0) 推荐(0)

(转)WPF性能优化点 http://www.cnblogs.com/YilingLai/archive/2007/01/19/624714.html
摘要:在建立漂亮UI的同时,我们还需要关注应用程序的性能,WPF尤其如此。下面从MS的文档中总结出了一些有用的性能优化点。在实际编写的过程中,可以参考。这个Post非完全原创,是根据一些文档总结出来的。1、建立逻辑树的时候,尽量考虑从父结点到子结点的顺序构建。因为当逻辑树的一个结点发生变化时(比如添加或删... 阅读全文

posted @ 2008-10-21 19:58 oyl 阅读(315) 评论(1) 推荐(0)

System.Windows.Markup.ContentPropertyAttribute
摘要:MSDN:http://msdn.microsoft.com/en-us/library/system.windows.markup.contentpropertyattribute.aspxWhen implementing a content property of a collection t... 阅读全文

posted @ 2008-10-21 19:03 oyl 阅读(299) 评论(0) 推荐(0)

如何处理frozon control (WPF FAQ http://www.syncfusion.com/faq/wpf/default.aspx#60)
摘要:将一个control freeze后能够提高其性能。If you try to modify a frozen Freezable object, it throws an 'Invalid Operation' Exception. To avoid throwing this exception... 阅读全文

posted @ 2008-10-20 15:22 oyl 阅读(201) 评论(0) 推荐(0)

Enumerate the visual tree and logic tree
摘要:How can I enumerate all the descendants of a visual object ? You can enumerate all the descendants of a visual object as follows :// Enumerate all the... 阅读全文

posted @ 2008-10-20 15:20 oyl 阅读(331) 评论(0) 推荐(0)

不能获得一个routed event 有多少个event handler
摘要:原来的普通eventHandler可以通过eventHandler clickHandler;clickHandler.GetInvocationList().Length 来获得foreach(delegate a in GetclickHandler.GetInvocationList()){}... 阅读全文

posted @ 2008-10-20 12:38 oyl 阅读(248) 评论(0) 推荐(0)

注意:匿名事件处理函数
摘要:if (button != null && button.m_defaultMenuItem != menuItem) {button.m_defaultMenuItem.IsEnabledChanged += delegate(object o, DependencyPropertyChanged... 阅读全文

posted @ 2008-10-20 12:27 oyl 阅读(157) 评论(0) 推荐(0)

What is the difference between ContentPresenter and ContentControl?
摘要:If you look at these two classes in reflector, you will notice the main difference between them: ContentControl derives from Control, and ContentPrese... 阅读全文

posted @ 2008-10-15 15:02 oyl 阅读(567) 评论(0) 推荐(0)

What is the difference between Binding and TemplateBinding?
摘要:Binding provides much more flexibility than TemplateBinding, but it’s more costly. TemplateBinding is limited to one scenario but very efficient in wh... 阅读全文

posted @ 2008-10-15 15:01 oyl 阅读(462) 评论(0) 推荐(0)

What is the difference between CollectionView and CollectionViewSource?
摘要:The short answer is that CollectionView is a view and CollectionViewSource is not. Every time you bind an ItemsControl directly to a collection, we cr... 阅读全文

posted @ 2008-10-15 14:58 oyl 阅读(464) 评论(0) 推荐(0)

(转)在WPF中自定义控件 CustomControl (下)注意TemplatePartAttribute
摘要:1, 控件UI部分与逻辑部分的耦合.这是一个容易被忽略但却非常重要的问题,我们之所以使用CustomControl而不是UserControl,是因为我们希望自己的控件能向WPF内置控件一样,其UI能轻易地被其他用户定制或我们将来所改变.也就是说其视觉树不能与后台逻辑纠缠在一起,因为其视觉树中的元素... 阅读全文

posted @ 2008-10-14 19:56 oyl 阅读(890) 评论(0) 推荐(0)

(转)在WPF中自定义控件 CustomControl (上)
摘要:1,新建CustomControl在选择控件基类后,第一件事情便是在你的项目中新建"CustomControl",我们会发现在项目中自动生成了一个*.CS(或*.VB或其他)文件以及\Themes\Generic.xaml(如果原来没有的话),他们分别是CustomControl的后台代码文件(Co... 阅读全文

posted @ 2008-10-14 19:53 oyl 阅读(522) 评论(0) 推荐(0)

How to get the control inside the ControlTemplate/DataTemplate on run time.
摘要:Here is a similar example to get control inside DataTemplate at runtime.XAML code: In the code behind: public partial class Window1 : W... 阅读全文

posted @ 2008-10-13 21:48 oyl 阅读(664) 评论(0) 推荐(0)

wpf isEnabled属性从其container继承下来的问题
摘要:Let's suppose we have the following xaml: Although the TextBox's IsEnabled property is set to true it will inherit it's value from it's container, in ... 阅读全文

posted @ 2008-10-13 21:39 oyl 阅读(718) 评论(0) 推荐(0)

导航