2012年4月27日
摘要: MVVM模式是Model-View-ViewModel的简称。1.Model层就是实体层,利用vs带的向项目中添加数据模型和向模型中添加代码生成项(自跟踪实体),可以快速方便的从数据库创建实体。这个也不是MVVM重点关注的。2.View层就是界面表现层,他包含展现给用户的具体页面,MVVM实现了表现层和业务逻辑层的彻底分离,这也是他的优势,更加方便了团队合作开发。采用MVVM模式做的项目,经常会发现界面后面几乎零代码,开始觉得很神奇,连一个事件都没有却实现了N多功能,这应该是归功于.Net平台的新特性,依赖属性。3.ViewModel层就是传统三层架构中的业务逻辑层,具体的业务逻辑就是在这里, 阅读全文
posted @ 2012-04-27 18:06 EvilGenius 阅读(986) 评论(0) 推荐(0) 编辑
摘要: <ListBoxName="lb_fileInfo"Grid.Row="1"Grid.ColumnSpan="3"ItemsSource="{Binding}"SelectionMode="Single"ScrollViewer.HorizontalScrollBarVisibility="Disabled"><ListBox.ItemsPanel><ItemsPanelTemplate><WrapPanelIsItemsHost=& 阅读全文
posted @ 2012-04-27 17:05 EvilGenius 阅读(1218) 评论(0) 推荐(0) 编辑
摘要: public class DataGridHelper { private DataGrid dataGrid; public DataGridHelper(DataGrid dataGrid) { this.dataGrid = dataGrid; } public T FindCellControl<T>(string name, int columnIndex) where T : Visual { DataRowView selectItem = dataGrid.SelectedItem as DataRowView; DataGridCell cell = GetCel 阅读全文
posted @ 2012-04-27 14:44 EvilGenius 阅读(1002) 评论(0) 推荐(0) 编辑