随笔分类 -  MEF

WPF自定义窗口样式小技巧
摘要:1窗口大小的调整,这个应该不算啥技巧,就是头次使用长长记性窗口模板中有ResizeGrip,并在ResizeMode="CanResizeWithGrip"时显示2WindowStyle=None时自定义按钮关闭窗体方法一:在某个cs文件中创建类,把关闭写在cs中,这样代码是很丑方法二:最近项目中用了CaliburnMicro,使得关闭窗口简单起来在自定义的按钮上添加cm:Action.Target="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}&qu 阅读全文

posted @ 2012-11-27 16:00 beastplus 阅读(304) 评论(0) 推荐(0)

MEF插件界面配置
摘要:public T GetConfig<T>(string sectionName) where T : ConfigurationSection{ try { Assembly assembly = typeof(T).Assembly; string directory = Path.GetDirectoryName(assembly.CodeBase); string filename = Path.GetFileName(assembly.CodeBase); string assemblyPath = Path.Combine(directory, file... 阅读全文

posted @ 2012-10-29 10:54 beastplus 阅读(219) 评论(0) 推荐(0)

导航