摘要: Reduce unnecessary invocations of the layout pass -- update a Transform rather than replacing itUse the most efficient Panel where possible -- don't use Grid if you need is CanvasUse Drawing which are cheaper than Shape objectsUse StreamGeometry, which is a light-weight alternative to PathGeomet 阅读全文
posted @ 2011-08-12 11:31 孤狼晖 阅读(648) 评论(0) 推荐(0) 编辑
摘要: RelayCommand : ICommand类A command whose sole purpose is to relay its functionality to otherobjects by invoking delegates. The default return value for the CanExecutemethod is 'true'. This class does not allow you to accept command parameters in theExecute and CanExecute callback methods.用来转发 阅读全文
posted @ 2011-08-12 09:01 孤狼晖 阅读(763) 评论(0) 推荐(0) 编辑
摘要: The definition of this class:The IsInDesignMode property is used to indicate whether is in the DesignMode.When we design the UI we usually use the blend ,so we need this property to bindthe view to a simple viewModel . 阅读全文
posted @ 2011-08-12 09:00 孤狼晖 阅读(485) 评论(0) 推荐(0) 编辑
摘要: 当我们使用MVVM开发模式进行开发时,ViewModel之间的通信常常是很头疼的事情,好在MVVM Light提供了Messenger类可以轻松的在ViewModel之间传递消息。MessengerMessenger 其他类成员可以通过Register 方法 来建立与Messenger的联系,注册时包含当收到Message的时候要执行的方法。当使用Send方法时,注册的相关的方法将会被调用。The Messager is a class allowing objects to exchange message.主要成员:Register method ://Registers a recipi 阅读全文
posted @ 2011-08-12 08:58 孤狼晖 阅读(960) 评论(0) 推荐(1) 编辑
摘要: 当我们使用依赖属性的时候,有时需要监听它的变化,这在写自定义控件的时候十分有用,下面介绍一种简单的方法。如下使用DependencyPropertyDescriptorDependencyPropertyDescriptor prop = DependencyPropertyDescriptor.FromProperty( MyType.MyDependencyProperty, typeof(M... 阅读全文
posted @ 2011-08-12 08:51 孤狼晖 阅读(685) 评论(0) 推荐(0) 编辑