public void ShowAllProducts() { MultiProductViewModel viewModel = this.ViewModels.FirstOrDefault(vm => vm is MultiProductViewModel) as MultiProductViewModel; if (viewModel == null) { viewModel = new MultiProductViewModel(repositorys); viewModel.RequestClose += this.OnWorkspaceRequestClose; this.ViewModels.Add(viewModel); } this.ActivateViewModel(viewModel); }
/// <summary> /// Shows all products. /// </summary> public void ShowAllProducts() { MultiProductViewModel viewModel = this.ViewModels.FirstOrDefault(vm => vm is MultiProductViewModel) as MultiProductViewModel; if (viewModel == null) { MultiProductViewModel mpvm = new MultiProductViewModel(this.repo); mpvm.RequestClose += this.OnWorkspaceRequestClose; this.ViewModels.Add(mpvm); } this.ActivateViewModel(viewModel); }