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 Task FadeOut()
        {
            Visibility = System.Windows.Visibility.Visible;

            var a = new DoubleAnimation
            {
                From         = 1.0,
                To           = 0.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.Hidden; };

            return(StoryboardExtensions.BeginAsync(storyboard));
        }