AvaloniaUI / Avalonia.Labs

Experimental Controls for Avalonia
MIT License
194 stars 25 forks source link

Add Transitions to FlipView and TabControl #72

Closed emmauss closed 2 months ago

emmauss commented 3 months ago

Adds animating scrollviewer to FlipView and TabControl, with gesture support. Inertial scrolling is removed currently. Also, adds 2 properties to FlipView to allow users to configure navigation and transition duration;

        /// <summary>
        /// Gets or sets whether navigation buttons are visible on the flipview.
        /// </summary>
        public bool IsButtonsVisible
        {
            get => GetValue(IsButtonsVisibleProperty);
            set => SetValue(IsButtonsVisibleProperty, value);
        }

        /// <summary>
        /// Gets or sets the duration of transitions for the flipview.
        /// </summary>
        public TimeSpan? TransitionDuration
        {
            get => GetValue(TransitionDurationProperty);
            set => SetValue(TransitionDurationProperty, value);
        }

The animated scrollviewer using Styled Transitions instead of Composition Transitions due to the inability of virtualizing panels to know the current transitioning offset of the scroll presenter, thus unloading and still visible container.