Пример #1
0
 public static void SetNextPanel(DependencyObject obj, ExtenPanel value)
 {
     obj.SetValue(NextPanelProperty, value);
 }
Пример #2
0
        void _MovePanel(ExtenPanel panel, double newY)
        {
            ExtenPanel nextPanel = GetNextPanel(panel);
            if (nextPanel != null)
            {
                double nextPanelY = newY + panel.VisibleHeight + (panel as FrameworkElement).Margin.Bottom + (nextPanel as FrameworkElement).Margin.Top;
                _MovePanel(nextPanel, nextPanelY);
            }

            if (panel != null)
            {
                string animationResourceName = (panel as FrameworkElement).Name + "Animation";
                Storyboard sb = Resources[animationResourceName] as Storyboard;

                if (sb != null)
                {
                    double goFromY = _GetElementTop(panel as UIElement);
                    double translation = (newY - goFromY) + _GetExistingTranslation(panel as UIElement);
                    ((sb.Children[0] as DoubleAnimationUsingKeyFrames).KeyFrames[0] as SplineDoubleKeyFrame).Value = translation;
                    sb.Begin();
                }
            }
        }
Пример #3
0
 public static void SetPreviousPanel(DependencyObject obj, ExtenPanel value)
 {
     obj.SetValue(PreviousPanelProperty, value);
 }
Пример #4
0
        private static void _ChangeState(ExtenPanel panel, string goToState, string stateStoryboardName)
        {
            if (panel != null && goToState != null)
            {
                VisualStateManager.GoToState((panel as Control), goToState, true);
            }

            if (stateStoryboardName != null)
            {
                Storyboard sb = (panel as FrameworkElement).Resources[stateStoryboardName] as Storyboard;
                if (sb != null)
                {
                    sb.Begin();
                }
            }
        }