public Task FadeIn() { using (var depMen = new DepartmentManagmentService()) { ((EmployeeCRUDVM)EmployeeGrid.DataContext).Departments = new ObservableCollection <DepartmentVM>(depMen.GetAll().ToList()); } Visibility = System.Windows.Visibility.Visible; var a = new DoubleAnimation { From = 0.0, To = 1.0, FillBehavior = FillBehavior.Stop, BeginTime = TimeSpan.FromSeconds(0), Duration = new Duration(TimeSpan.FromSeconds(0.2)) }; var storyboard = new Storyboard(); storyboard.Children.Add(a); Storyboard.SetTarget(a, this); Storyboard.SetTargetProperty(a, new PropertyPath(OpacityProperty)); storyboard.Completed += delegate { Visibility = System.Windows.Visibility.Visible; }; return(StoryboardExtensions.BeginAsync(storyboard)); }
public DepartmentCRUDVM() { depService = new DepartmentManagmentService(); IMapper mapper = new MapperConfiguration(cfg => { cfg.CreateMap <Department, DepartmentVM>(); }).CreateMapper(); departments = new ObservableCollection <DepartmentVM>(depService.GetAll()); }
public EmployeeCRUDVM() { emplService = new EmployeeManagmentService(); depService = new DepartmentManagmentService(); IMapper mapper = new MapperConfiguration(cfg => { cfg.CreateMap <Employee, EmployeeVM>(); cfg.CreateMap <DepartmentEmployee, EmployeeVM>(); }).CreateMapper(); employees = new ObservableCollection <EmployeeVM>(emplService.GetAll()); departments = new ObservableCollection <DepartmentVM>(depService.GetAll()); }