Пример #1
0
        private void OnTransitionChanged(TransitioningContentControl source, AvaloniaPropertyChangedEventArgs e)
        {
            var oldTransition = (TransitionType)e.OldValue;
            var newTransition = (TransitionType)e.NewValue;

            if (source.IsTransitioning)
            {
                source.AbortTransition();
            }

            //// find new transition
            //Storyboard newStoryboard = source.GetStoryboard(newTransition);

            //// unable to find the transition.
            //if (newStoryboard == null)
            //{
            //    // could be during initialization of xaml that presentationgroups was not yet defined
            //    if (VisualStates.TryGetVisualStateGroup(source, PresentationGroup) == null)
            //    {
            //        // will delay check
            //        source.CurrentTransition = null;
            //    }
            //    else
            //    {
            //        // revert to old value
            //        source.SetValue(TransitionProperty, oldTransition);

            //        throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Temporary removed exception message", newTransition));
            //    }
            //}
            //else
            //{
            //    source.CurrentTransition = newStoryboard;
            //}
        }
Пример #2
0
 private void OnIsTransitioningPropertyChanged(TransitioningContentControl o, AvaloniaPropertyChangedEventArgs e)
 {
     if (!o.allowIsTransitioningPropertyWrite)
     {
         o.IsTransitioning = (bool)e.OldValue;
         throw new InvalidOperationException();
     }
 }
Пример #3
0
 private void OnRestartTransitionOnContentChangePropertyChanged(TransitioningContentControl o, AvaloniaPropertyChangedEventArgs e)
 {
     o.OnRestartTransitionOnContentChangeChanged((bool)e.OldValue, (bool)e.NewValue);
 }
Пример #4
0
 private void OnContentChangeChanged(TransitioningContentControl o, AvaloniaPropertyChangedEventArgs e)
 {
     StartTransition(e.OldValue, e.NewValue);
 }