首先在xaml中创建集合是一个不可取的方法. 本方法仅作为xaml的学习. 本文略微无聊,主要是编写的东西都是老玩意. 首先是定义一个类,作为你要加载集合的模型. 结构如下 internal class Student { public string Name { get; set; } public int Age { get; set; } } internal class StudentList:List<Student> { } class StringCollect { public…
这篇博客将介绍在MVVM模式ViewModel中关闭和打开View的方法. 1. ViewModel中关闭View public class MainViewModel { public DelegateCommand<Window> CloseWindowCommand { get; private set; } public MainViewModel() { CloseWindowCommand = new DelegateCommand<Window>(CloseWindo…