public FileTypeWindowViewModel(ChildWindow aChildWindow, FileTypeWindowType aFileTypeWindowType, FileTypeEntity aFileTypeEntity) { childWindow = aChildWindow; fileTypeWindowType = aFileTypeWindowType; FileTypeEntity = aFileTypeEntity; if (aFileTypeWindowType == FileTypeWindowType.ADD) { Title = "添加档案类型"; } else { Title = "修改档案类型"; } OnOK = new DelegateCommand(onOK); OnCancel = new DelegateCommand(onCancel); }
public FileTypeWindow(FileTypeWindowType aFileTypeWindowType, FileTypeEntity aFileTypeEntity) { InitializeComponent(); this.DataContext = new FileTypeWindowViewModel(this, aFileTypeWindowType, aFileTypeEntity); }