11 2017 档案

摘要:DDD:domain-driven design 领域驱动设计。一种团队使用的方法。 CQRS:command-query responsibility segregation。命令查询职责分离。 阅读全文
posted @ 2017-11-28 14:14 liu_xh 阅读(304) 评论(0) 推荐(0) 编辑
摘要:使用先前的数据上下文,可以通过使用LINQ查询,按字母顺序检索出所有专辑,代码如下 阅读全文
posted @ 2017-11-28 14:11 liu_xh 阅读(949) 评论(0) 推荐(0) 编辑
摘要:<body> <div id="main-content">@RenderBody()</div> <footer>@RenderSection("Footer")</footer> </body> 引用上述模版的时候, <p>this is the main Content</p> @sectio 阅读全文
posted @ 2017-11-28 11:47 liu_xh 阅读(111) 评论(0) 推荐(0) 编辑
摘要:通常访问视图的时候,都会去选择访问Views文件夹内对应于Controller同名的文件夹下的某一个视图,这个视图对应于这个Controller类的某一个方法。 其实,也可以让这个方法对应于不同名的cshtml文件。 例如: HomeController类中有一个方法Index(),通常return 阅读全文
posted @ 2017-11-28 10:55 liu_xh 阅读(280) 评论(0) 推荐(0) 编辑
摘要:整个程序如下,从博客园一个作者看到的例子,但是对这个例子做了点修改。我觉得这个更符合MVVM模式。这个用到了prism框架,在项目中要引用Microsoft.Practices.Prism.dll 按照程序开发顺序记录如下步骤: 一、先设计界面,这样才知道有哪些Model。 相应的xaml代码如下: 阅读全文
posted @ 2017-11-27 20:09 liu_xh 阅读(1063) 评论(0) 推荐(0) 编辑
摘要:1 if (MessageBox.Show("是否退出系统?", "退出系统?", MessageBoxButton.OKCancel, MessageBoxImage.Question) == MessageBoxResult.OK) 2 { 3 this.Close(); 4 } 阅读全文
posted @ 2017-11-27 16:45 liu_xh 阅读(1149) 评论(0) 推荐(0) 编辑
摘要:在MVVM模式中,View封装UI和UI逻辑,viewmodel封装presentation逻辑,model封装业务逻辑和数据。 View类 View的责任是定义屏幕上的结构和外观,在完美的情况下,view的code behind只包含一个构造函数,这个构造函数调用InitializeCompone 阅读全文
posted @ 2017-11-27 15:03 liu_xh 阅读(547) 评论(0) 推荐(0) 编辑
摘要:bing.com搜索prism wpf,进入第一个http://compositewpf.codeplex.com/,下载Prism 4.1 for Silverlight 5 and .NET 4.0,运行解压到C:\Program Files (x86)\Microsoft Prism,运行Re 阅读全文
posted @ 2017-11-27 10:37 liu_xh 阅读(445) 评论(0) 推荐(0) 编辑
摘要:把静态页面放到@Url.Content();中,如href="@Url.Content("a.html")" 阅读全文
posted @ 2017-11-17 10:24 liu_xh 阅读(1958) 评论(0) 推荐(0) 编辑
摘要:XMAL代码如下: <Image Name="ImageToSave" Source="Images/pic_bg.png" Grid.RowSpan="3" Grid.ColumnSpan="3" ></Image> C#代码如下: SaveFileDialog sfd = new SaveFil 阅读全文
posted @ 2017-11-15 19:49 liu_xh 阅读(5401) 评论(0) 推荐(0) 编辑
摘要:public static class DispatcherHelper { [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public stati 阅读全文
posted @ 2017-11-15 17:00 liu_xh 阅读(1269) 评论(0) 推荐(0) 编辑
摘要:一、今天用vs2013新建wpf程序,项目名称命名为MainWindow,一启动就出现错误:类型“MainWindow.MainWindow”中不存在类型名称"App"。博主顿时很崩溃,这是神码情况,玩我呢,项目才开始。幸好博主心理素质不错,在百度一番之后总算找到解决方法: 就是这个在搞破坏,然后把 阅读全文
posted @ 2017-11-14 11:03 liu_xh 阅读(228) 评论(0) 推荐(0) 编辑
摘要:一、显示 Grid的线条,设置ShowGridLiens="True"。 阅读全文
posted @ 2017-11-11 13:02 liu_xh 阅读(190) 评论(0) 推荐(0) 编辑
摘要:一、sender是触发事件的控件。 二、XAML中的一个控件对应C#的一个类。 三、每个控件或者元素都是一个XAML标签,一个XAML标签一般就是new一个对象。 四、属性赋值的两种方法: 1、<Button Content="按钮" ></Button> 2、<Button> <Button.Co 阅读全文
posted @ 2017-11-01 14:35 liu_xh 阅读(224) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示