/// <summary> /// 创建视图二 /// </summary> private void CreateSecondView(object obj) { var model = new SecondViewModel(); WorkspaceMulti.Add(model); ShowCurrentView(model); }
/// <summary> /// 显示视图二命令 /// </summary> private void ShowSecondView(object obj) { if (_workspaceStory == null) { _workspaceStory = new ObservableCollection <WorkspaceViewModel>(); } var model = this._workspaceStory.FirstOrDefault(vm => vm is SecondViewModel) as SecondViewModel; if (model == null) { model = new SecondViewModel(); _workspaceStory.Add(model); } WorkspaceSingle = model; }