protected internal override void BeginTransition(TransitionPresenter transitionElement, ContentPresenter oldContent, ContentPresenter newContent)
        {
            TranslateTransform tt = new TranslateTransform(StartPoint.X * transitionElement.ActualWidth, StartPoint.Y * transitionElement.ActualHeight);

            if (IsNewContentTopmost)
                newContent.RenderTransform = tt;
            else
                oldContent.RenderTransform = tt;

            DoubleAnimation da = new DoubleAnimation(EndPoint.X * transitionElement.ActualWidth, Duration);
            tt.BeginAnimation(TranslateTransform.XProperty, da);

            da.To = EndPoint.Y * transitionElement.ActualHeight;
            da.Completed += delegate
                {
                    EndTransition(transitionElement, oldContent, newContent);
                };
            tt.BeginAnimation(TranslateTransform.YProperty, da);
        }
Beispiel #2
0
 //Transitions can override this to perform cleanup at the end of the transition
 protected virtual void OnTransitionEnded(TransitionPresenter transitionElement, ContentPresenter oldContent, ContentPresenter newContent)
 {
 }
Beispiel #3
0
        //Transitions should call this method when they are done
        protected void EndTransition(TransitionPresenter transitionElement, ContentPresenter oldContent, ContentPresenter newContent)
        {
            OnTransitionEnded(transitionElement, oldContent, newContent);

            transitionElement.OnTransitionCompleted();
        }
Beispiel #4
0
 // Called when an element is Removed from the TransitionPresenter's visual tree
 protected internal virtual void BeginTransition(TransitionPresenter transitionElement, ContentPresenter oldContent, ContentPresenter newContent)
 {
     EndTransition(transitionElement, oldContent, newContent);
 }
 protected override void OnTransitionEnded(TransitionPresenter transitionElement, ContentPresenter oldContent, ContentPresenter newContent)
 {
     newContent.ClearValue(ContentPresenter.RenderTransformProperty);
     oldContent.ClearValue(ContentPresenter.RenderTransformProperty);
 }