コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
        }