07 2011 档案
摘要:When you are in a DataTemplate, the DataContext might not be what you expect. Typically the DataContext in a DataTemplate is set to the item that the DataTemplate represents. If your TextChanged command is on the "main viewmodel" instead of the data item, you need to be more precise in the
阅读全文
摘要:There are no DateTime functions available for snippets but here is a macro that will insert the current DateTime: Sub PrintDateTime() If (Not IsNothing(DTE.ActiveDocument)) Then Dim selection As TextSelection = DTE.ActiveDocument.Selection selection.Insert(DateTime.Now.ToString()) End IfEnd Sub You
阅读全文
摘要:BaseForm frm = (BaseForm)Assembly.Load(程序集名称).CreateInstance(完整类名称);
阅读全文
摘要:工厂方法模式:一个抽象产品类,可以派生出多个具体产品类。 一个抽象工厂类,可以派生出多个具体工厂类。 每个具体工厂类只能创建一个具体产品类的实例。抽象工厂模式:多个抽象产品类,每个抽象产品类可以派生出多个具体产品类。 一个抽象工厂类,可以派生出多个具体工厂类。 每个具体工厂类可以创建多个具体产品类的实例。 区别:工厂方法模式只有一个抽象产品类,而抽象工厂模式有多个。 工厂方法模式的具体工厂类只能创建一个具体产品类的实例,而抽象工厂模式可以创建多个。
阅读全文
摘要:一、公共类namespaceGh.Ticket.Common{publicclassExtendedCommandParameter{publicExtendedCommandParameter(EventArgseventArgs,FrameworkElementsender,objectparameter){EventArgs=eventArgs;Sender=sender;Parameter=parameter;}publicEventArgsEventArgs{get;privateset;}publicFrameworkElementSender{get;privateset;}pu
阅读全文
摘要:原理:HttpModule模块在任何请求发生时都会执行,所有可以在该类中执行Url的重映射跳转第一步:定义IHttpModulepublicclassUrlRemapper:IHttpModule{publicvoidInit(HttpApplicationcontext){context.Begi...
阅读全文
摘要:由于使用的是prism框架,所有需要首先引入Prism4\Lib\Desktop下的Microsoft.Expression.Interactions.dllSystem.Windows.Interactivity.dllXAML文件xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"绑定事件<ButtonContent="MouseLeave事?件t"Width="70"Height="25"><i:Intera
阅读全文
摘要:原文地址 :http://blog.roboblob.com/2010/01/26/binding-ui-events-from-view-to-commands-in-viewmodel-in-silverlight-4/Today we will touch another problem that people starting with MVVM very often fail to address properly: Handling the UI Events of the View in the ViewModel while avoiding placing any logic
阅读全文

浙公网安备 33010602011771号