Exemplo n.º 1
0
        private void ToggleView(Control ui, bool isShow)
        {
            DoubleAnimation animation;

            if (isShow)
            {
                if (ui.ActualWidth != 0)
                {
                    return;
                }
                animation = CustomAnimation.GetEnteringScreenAnimation(0,
                                                                       ui is Label ? _widthOfToLabel : _widthOfTimeChooser, false);
                ui.BeginAnimation(WidthProperty, animation);
            }
            else
            {
                if (ui.ActualWidth == 0)
                {
                    return;
                }
                animation =
                    CustomAnimation.GetLeavingScreenAnimation(ui is Label ? _widthOfToLabel : _widthOfTimeChooser, 0,
                                                              false);
                ui.BeginAnimation(WidthProperty, animation);
            }
        }
        private void GoToEditableMode()
        {
            var da = CustomAnimation.GetEnteringScreenAnimation(0, 45, false);

            StackPanel_Bottom.BeginAnimation(HeightProperty, da);
            ComboBox.Visibility      = Visible;
            TextBlock.Visibility     = Hidden;
            Button_Pencil.Visibility = Hidden;
        }
Exemplo n.º 3
0
        private void AddRuleButton_OnClick(object sender, RoutedEventArgs e)
        {
            ScrollViewer.ScrollToEnd();
            var r = new RuleSetter();

            r.xButton_Clicked += (o, args) => {
                var animation = CustomAnimation.GetLeavingScreenAnimation(r.ActualHeight, 0);
                animation.Completed += (sender1, eventArgs) => { innerSp.Children.Remove(o as RuleSetter); };
                r.BeginAnimation(HeightProperty, animation);
            };
            r.Loaded +=
                (o, args) => {
                r.BeginAnimation(HeightProperty,
                                 CustomAnimation.GetEnteringScreenAnimation(0, r.ActualHeight));
            };
            innerSp.Children.Add(r);
        }
        private void AnimateHiddenContent(bool IsExpand)
        {
            double totalHeight = CreateTimetableButton.ActualHeight;

            if (IsExpand)
            {
                if (InnerSp.Height == 0)
                {
                    InnerSp.BeginAnimation(HeightProperty,
                                           CustomAnimation.GetEnteringScreenAnimation(0, totalHeight, false));
                    ResetButton.IsEnabled = true;
                    AddSlotButton.Content = "Add more slots";
                }
            }
            else
            {
                InnerSp.BeginAnimation(HeightProperty, CustomAnimation.GetLeavingScreenAnimation(totalHeight, 0, false));
                ResetButton.IsEnabled = false;
                AddSlotButton.Content = "Add slots";
            }
        }
        private void UpdateBottomPanelVisibility()
        {
            DoubleAnimation da;

            if (UIDofSelectedSlots.Count == 0)
            {
                da = CustomAnimation.GetLeavingScreenAnimation(70, 0, false);
                ViewChanger.Badge = null;
                if (ViewChangerButton.Content.ToString() == "Show all subjects")
                {
                    return;
                }
            }
            else
            {
                da = CustomAnimation.GetEnteringScreenAnimation(0, 70, false);
                ViewChanger.Badge = GetNamesOfCheckedSubject().Length;
                if (BottomPanel.ActualHeight > 0)
                {
                    return;
                }
            }
            BottomPanel.BeginAnimation(HeightProperty, da);
        }