예제 #1
0
        private void HideWorkSubsectionSelection()
        {
            OpacityGrid.IsEnabled = true;
            WorkSubsectionSelectionListBox.ItemsSource = null;

            var widthAnimation = new DoubleAnimation(0d, new Duration(TimeSpan.FromMilliseconds(200)));

            WorkSubsectionSelectionGrid.BeginAnimation(WidthProperty, widthAnimation);

            var shadowColor = new Color {
                A = 0, R = 0, G = 0, B = 0
            };
            var colorAnimation = new ColorAnimation(shadowColor, new Duration(TimeSpan.FromMilliseconds(200)));

            colorAnimation.Completed += (s, args) => { ShadowGrid.Visibility = Visibility.Collapsed; };
            ShadowGrid.Background.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
        }
예제 #2
0
        private void ShowWorkSubsectionSelection(long workerAdmissionId, bool deleteSelection)
        {
            OpacityGrid.IsEnabled = false;
            ShadowGrid.Visibility = Visibility.Visible;

            if (deleteSelection)
            {
                ChangeWorkSubsectionWorkerAdmissionButton.Visibility = Visibility.Collapsed;
                DeleteWorkSubsectionWorkerAdmissionButton.Visibility = Visibility.Visible;

                WorkSubsectionSelectionChangeTextBlock.Visibility = Visibility.Collapsed;
                WorkSubsectionSelectionDeleteTextBlock.Visibility = Visibility.Visible;
            }
            else
            {
                ChangeWorkSubsectionWorkerAdmissionButton.Visibility = Visibility.Visible;
                DeleteWorkSubsectionWorkerAdmissionButton.Visibility = Visibility.Collapsed;

                WorkSubsectionSelectionChangeTextBlock.Visibility = Visibility.Visible;
                WorkSubsectionSelectionDeleteTextBlock.Visibility = Visibility.Collapsed;
            }

            var workOperationWorkerAdmissions = _admClass.WorkOperationWorkerAdmissionsTable.Select(string.Format("WorkerAdmissionID = {0}", workerAdmissionId));

            if (workOperationWorkerAdmissions.Any())
            {
                var workSubsectionIds = workOperationWorkerAdmissions.Select(r => r.Field <Int64>("WorkSubsectionID")).Distinct();
                WorkSubsectionSelectionListBox.ItemsSource = workSubsectionIds;
            }
            else
            {
                WorkSubsectionSelectionListBox.ItemsSource = null;
            }

            var widthAnimation = new DoubleAnimation(351d, new Duration(TimeSpan.FromMilliseconds(200)));

            WorkSubsectionSelectionGrid.BeginAnimation(WidthProperty, widthAnimation);

            var shadowColor = new Color {
                A = 20, R = 0, G = 0, B = 0
            };
            var colorAnimation = new ColorAnimation(shadowColor, new Duration(TimeSpan.FromMilliseconds(200)));

            ShadowGrid.Background.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
        }