private void OnEmployeeAdded(object sender, EntityAddedEventArgs <Employee> e) { AllEmployeesViewModel workspace = this.Workspaces.FirstOrDefault(vm => vm is AllEmployeesViewModel) as AllEmployeesViewModel; if (workspace != null) { workspace.ModifyEntity(e.NewEntity); } }
private void ShowEmployess() { AllEmployeesViewModel workspace = this.Workspaces.FirstOrDefault(vm => vm is AllEmployeesViewModel) as AllEmployeesViewModel; if (workspace == null) { workspace = new AllEmployeesViewModel(); workspace.EmployeeEdit += OnEmployeeEdit; this.Workspaces.Add(workspace); } this.SetActiveWorkspace(workspace); }