diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml index 142d0d42b1..db0f3cce7c 100644 --- a/samples/ControlCatalog/MainView.xaml +++ b/samples/ControlCatalog/MainView.xaml @@ -2,9 +2,9 @@ xmlns:pages="clr-namespace:ControlCatalog.Pages;assembly=ControlCatalog" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - + - + diff --git a/samples/ControlCatalog/Pages/CarouselPage.xaml b/samples/ControlCatalog/Pages/CarouselPage.xaml index 4a5b2cea26..3468b71fd8 100644 --- a/samples/ControlCatalog/Pages/CarouselPage.xaml +++ b/samples/ControlCatalog/Pages/CarouselPage.xaml @@ -8,9 +8,9 @@ - + - + diff --git a/samples/ControlCatalog/Pages/CarouselPage.xaml.cs b/samples/ControlCatalog/Pages/CarouselPage.xaml.cs index 272290e679..5e24bfb58f 100644 --- a/samples/ControlCatalog/Pages/CarouselPage.xaml.cs +++ b/samples/ControlCatalog/Pages/CarouselPage.xaml.cs @@ -37,13 +37,13 @@ namespace ControlCatalog.Pages switch (_transition.SelectedIndex) { case 0: - _carousel.Transition = null; + _carousel.PageTransition = null; break; case 1: - _carousel.Transition = new PageSlide(TimeSpan.FromSeconds(0.25), _orientation.SelectedIndex == 0 ? PageSlide.SlideAxis.Horizontal : PageSlide.SlideAxis.Vertical); + _carousel.PageTransition = new PageSlide(TimeSpan.FromSeconds(0.25), _orientation.SelectedIndex == 0 ? PageSlide.SlideAxis.Horizontal : PageSlide.SlideAxis.Vertical); break; case 2: - _carousel.Transition = new CrossFade(TimeSpan.FromSeconds(0.25)); + _carousel.PageTransition = new CrossFade(TimeSpan.FromSeconds(0.25)); break; } } diff --git a/samples/ControlCatalog/SideBar.xaml b/samples/ControlCatalog/SideBar.xaml index 7fcd828ba3..3013c5a80e 100644 --- a/samples/ControlCatalog/SideBar.xaml +++ b/samples/ControlCatalog/SideBar.xaml @@ -20,7 +20,7 @@ MemberSelector="{x:Static TabControl.ContentSelector}" Items="{TemplateBinding Items}" SelectedIndex="{TemplateBinding Path=SelectedIndex}" - Transition="{TemplateBinding Transition}" + PageTransition="{TemplateBinding PageTransition}" Grid.Row="1"/> diff --git a/samples/RenderTest/MainWindow.xaml b/samples/RenderTest/MainWindow.xaml index 9e9a600161..f63dec230e 100644 --- a/samples/RenderTest/MainWindow.xaml +++ b/samples/RenderTest/MainWindow.xaml @@ -22,9 +22,9 @@ - + - + diff --git a/samples/RenderTest/SideBar.xaml b/samples/RenderTest/SideBar.xaml index 7fcd828ba3..3013c5a80e 100644 --- a/samples/RenderTest/SideBar.xaml +++ b/samples/RenderTest/SideBar.xaml @@ -20,7 +20,7 @@ MemberSelector="{x:Static TabControl.ContentSelector}" Items="{TemplateBinding Items}" SelectedIndex="{TemplateBinding Path=SelectedIndex}" - Transition="{TemplateBinding Transition}" + PageTransition="{TemplateBinding PageTransition}" Grid.Row="1"/> diff --git a/src/Avalonia.Controls/Carousel.cs b/src/Avalonia.Controls/Carousel.cs index e7c934091a..069bf40820 100644 --- a/src/Avalonia.Controls/Carousel.cs +++ b/src/Avalonia.Controls/Carousel.cs @@ -21,10 +21,10 @@ namespace Avalonia.Controls AvaloniaProperty.Register(nameof(IsVirtualized), true); /// - /// Defines the property. + /// Defines the property. /// - public static readonly StyledProperty TransitionProperty = - AvaloniaProperty.Register(nameof(Transition)); + public static readonly StyledProperty PageTransitionProperty = + AvaloniaProperty.Register(nameof(PageTransition)); /// /// The default value of for @@ -57,10 +57,10 @@ namespace Avalonia.Controls /// /// Gets or sets the transition to use when moving between pages. /// - public IPageTransition Transition + public IPageTransition PageTransition { - get { return GetValue(TransitionProperty); } - set { SetValue(TransitionProperty, value); } + get { return GetValue(PageTransitionProperty); } + set { SetValue(PageTransitionProperty, value); } } /// diff --git a/src/Avalonia.Controls/Presenters/CarouselPresenter.cs b/src/Avalonia.Controls/Presenters/CarouselPresenter.cs index b50b110761..5156a11b30 100644 --- a/src/Avalonia.Controls/Presenters/CarouselPresenter.cs +++ b/src/Avalonia.Controls/Presenters/CarouselPresenter.cs @@ -33,12 +33,13 @@ namespace Avalonia.Controls.Presenters (o, v) => o.SelectedIndex = v); /// - /// Defines the property. + /// Defines the property. /// - public static readonly StyledProperty TransitionProperty = - Carousel.TransitionProperty.AddOwner(); + public static readonly StyledProperty PageTransitionProperty = + Carousel.PageTransitionProperty.AddOwner(); private int _selectedIndex = -1; + private Task _current; private Task _currentTransition; private int _queuedTransitionIndex = -1; @@ -88,10 +89,10 @@ namespace Avalonia.Controls.Presenters /// /// Gets or sets a transition to use when switching pages. /// - public IPageTransition Transition + public IPageTransition PageTransition { - get { return GetValue(TransitionProperty); } - set { SetValue(TransitionProperty, value); } + get { return GetValue(PageTransitionProperty); } + set { SetValue(PageTransitionProperty, value); } } /// @@ -121,7 +122,7 @@ namespace Avalonia.Controls.Presenters } /// - /// Moves to the selected page, animating if a is set. + /// Moves to the selected page, animating if a is set. /// /// The index of the old page. /// The index of the new page. @@ -144,9 +145,9 @@ namespace Avalonia.Controls.Presenters to = GetOrCreateContainer(toIndex); } - if (Transition != null && (from != null || to != null)) + if (PageTransition != null && (from != null || to != null)) { - await Transition.Start((Visual)from, (Visual)to, fromIndex < toIndex); + await PageTransition.Start((Visual)from, (Visual)to, fromIndex < toIndex); } else if (to != null) { diff --git a/src/Avalonia.Controls/TabControl.cs b/src/Avalonia.Controls/TabControl.cs index 231274b873..70cf8b4e05 100644 --- a/src/Avalonia.Controls/TabControl.cs +++ b/src/Avalonia.Controls/TabControl.cs @@ -14,10 +14,10 @@ namespace Avalonia.Controls public class TabControl : SelectingItemsControl { /// - /// Defines the property. + /// Defines the property. /// - public static readonly StyledProperty TransitionProperty = - Avalonia.Controls.Carousel.TransitionProperty.AddOwner(); + public static readonly StyledProperty PageTransitionProperty = + Avalonia.Controls.Carousel.PageTransitionProperty.AddOwner(); /// /// Defines an that selects the content of a . @@ -68,10 +68,10 @@ namespace Avalonia.Controls /// /// Gets or sets the transition to use when switching tabs. /// - public IPageTransition Transition + public IPageTransition PageTransition { - get { return GetValue(TransitionProperty); } - set { SetValue(TransitionProperty, value); } + get { return GetValue(PageTransitionProperty); } + set { SetValue(PageTransitionProperty, value); } } /// diff --git a/src/Avalonia.Themes.Default/Carousel.xaml b/src/Avalonia.Themes.Default/Carousel.xaml index c7bf296ede..efe12c4333 100644 --- a/src/Avalonia.Themes.Default/Carousel.xaml +++ b/src/Avalonia.Themes.Default/Carousel.xaml @@ -10,7 +10,7 @@ Margin="{TemplateBinding Padding}" MemberSelector="{TemplateBinding MemberSelector}" SelectedIndex="{TemplateBinding SelectedIndex}" - Transition="{TemplateBinding Transition}"/> + PageTransition="{TemplateBinding PageTransition}"/> diff --git a/src/Avalonia.Themes.Default/TabControl.xaml b/src/Avalonia.Themes.Default/TabControl.xaml index f8fb4a1f49..0196c1f3ab 100644 --- a/src/Avalonia.Themes.Default/TabControl.xaml +++ b/src/Avalonia.Themes.Default/TabControl.xaml @@ -14,7 +14,7 @@ MemberSelector="{x:Static TabControl.ContentSelector}" Items="{TemplateBinding Items}" SelectedIndex="{TemplateBinding Path=SelectedIndex}" - Transition="{TemplateBinding Transition}" + PageTransition="{TemplateBinding PageTransition}" Grid.Row="1"/> diff --git a/tests/Avalonia.Controls.UnitTests/CarouselTests.cs b/tests/Avalonia.Controls.UnitTests/CarouselTests.cs index 4ce83056c6..4d38ec9856 100644 --- a/tests/Avalonia.Controls.UnitTests/CarouselTests.cs +++ b/tests/Avalonia.Controls.UnitTests/CarouselTests.cs @@ -102,7 +102,7 @@ namespace Avalonia.Controls.UnitTests [~CarouselPresenter.ItemsProperty] = control[~Carousel.ItemsProperty], [~CarouselPresenter.ItemsPanelProperty] = control[~Carousel.ItemsPanelProperty], [~CarouselPresenter.SelectedIndexProperty] = control[~Carousel.SelectedIndexProperty], - [~CarouselPresenter.TransitionProperty] = control[~Carousel.TransitionProperty], + [~CarouselPresenter.PageTransitionProperty] = control[~Carousel.PageTransitionProperty], }; } } diff --git a/tests/Avalonia.Controls.UnitTests/TabControlTests.cs b/tests/Avalonia.Controls.UnitTests/TabControlTests.cs index 67b224d6a0..322c14c6bd 100644 --- a/tests/Avalonia.Controls.UnitTests/TabControlTests.cs +++ b/tests/Avalonia.Controls.UnitTests/TabControlTests.cs @@ -313,7 +313,7 @@ namespace Avalonia.Controls.UnitTests [!CarouselPresenter.ItemsPanelProperty] = control[!ItemsControl.ItemsPanelProperty], [!CarouselPresenter.MemberSelectorProperty] = control[!ItemsControl.MemberSelectorProperty], [!CarouselPresenter.SelectedIndexProperty] = control[!SelectingItemsControl.SelectedIndexProperty], - [~CarouselPresenter.TransitionProperty] = control[~Carousel.TransitionProperty], + [~CarouselPresenter.PageTransitionProperty] = control[~Carousel.PageTransitionProperty], }; }