diff --git a/samples/TestApplication/GalleryStyle.cs b/samples/TestApplication/GalleryStyle.cs index 44dac4cf85..060ec13141 100644 --- a/samples/TestApplication/GalleryStyle.cs +++ b/samples/TestApplication/GalleryStyle.cs @@ -104,13 +104,13 @@ namespace TestApplication } } }, - new Deck + new Carousel { - Name = "deck", + Name = "carousel", MemberSelector = control.ContentSelector, - [~Deck.TransitionProperty] = control[~TabControl.TransitionProperty], - [!Deck.ItemsProperty] = control[!ItemsControl.ItemsProperty], - [!Deck.SelectedItemProperty] = control[!SelectingItemsControl.SelectedItemProperty], + [~Carousel.TransitionProperty] = control[~TabControl.TransitionProperty], + [!Carousel.ItemsProperty] = control[!ItemsControl.ItemsProperty], + [!Carousel.SelectedItemProperty] = control[!SelectingItemsControl.SelectedItemProperty], [Grid.ColumnProperty] = 1, } } diff --git a/samples/TestApplication/Program.cs b/samples/TestApplication/Program.cs index 2b2adb9b16..151a8471d9 100644 --- a/samples/TestApplication/Program.cs +++ b/samples/TestApplication/Program.cs @@ -471,7 +471,7 @@ namespace TestApplication private static TabItem ImagesTab() { - var imageDeck = new Deck + var imageCarousel = new Carousel { Width = 400, Height = 400, @@ -507,18 +507,18 @@ namespace TestApplication prev.Click += (s, e) => { - if (imageDeck.SelectedIndex == 0) - imageDeck.SelectedIndex = 1; + if (imageCarousel.SelectedIndex == 0) + imageCarousel.SelectedIndex = 1; else - imageDeck.SelectedIndex--; + imageCarousel.SelectedIndex--; }; next.Click += (s, e) => { - if (imageDeck.SelectedIndex == 1) - imageDeck.SelectedIndex = 0; + if (imageCarousel.SelectedIndex == 1) + imageCarousel.SelectedIndex = 0; else - imageDeck.SelectedIndex++; + imageCarousel.SelectedIndex++; }; return new TabItem @@ -537,7 +537,7 @@ namespace TestApplication { new TextBlock { - Text = "Deck", + Text = "Carousel", FontWeight = FontWeight.Medium, FontSize = 20, Foreground = SolidColorBrush.Parse("#212121"), @@ -551,13 +551,13 @@ namespace TestApplication }, new StackPanel { - Name = "deckVisual", + Name = "carouselVisual", Orientation = Orientation.Horizontal, Gap = 4, Children = new Controls { prev, - imageDeck, + imageCarousel, next } } diff --git a/samples/XamlTestApplicationPcl/Views/MainWindow.paml b/samples/XamlTestApplicationPcl/Views/MainWindow.paml index 69c612f526..3dfac47f36 100644 --- a/samples/XamlTestApplicationPcl/Views/MainWindow.paml +++ b/samples/XamlTestApplicationPcl/Views/MainWindow.paml @@ -5,9 +5,9 @@ Title="Perspex Test Application" Height="350" Width="525" SizeToContent="WidthAndHeight" > - + diff --git a/src/Perspex.Controls/Deck.cs b/src/Perspex.Controls/Carousel.cs similarity index 79% rename from src/Perspex.Controls/Deck.cs rename to src/Perspex.Controls/Carousel.cs index 1cdfdad239..1c12b634d0 100644 --- a/src/Perspex.Controls/Deck.cs +++ b/src/Perspex.Controls/Carousel.cs @@ -12,27 +12,27 @@ namespace Perspex.Controls /// /// An items control that displays its items as pages that fill the control. /// - public class Deck : SelectingItemsControl + public class Carousel : SelectingItemsControl { /// /// Defines the property. /// public static readonly PerspexProperty TransitionProperty = - PerspexProperty.Register("Transition"); + PerspexProperty.Register("Transition"); /// - /// The default value of for . + /// The default value of for . /// private static readonly ITemplate PanelTemplate = new FuncTemplate(() => new Panel()); /// - /// Initializes static members of the class. + /// Initializes static members of the class. /// - static Deck() + static Carousel() { - SelectionModeProperty.OverrideDefaultValue(SelectionMode.AlwaysSelected); - ItemsPanelProperty.OverrideDefaultValue(PanelTemplate); + SelectionModeProperty.OverrideDefaultValue(SelectionMode.AlwaysSelected); + ItemsPanelProperty.OverrideDefaultValue(PanelTemplate); } /// diff --git a/src/Perspex.Controls/Perspex.Controls.csproj b/src/Perspex.Controls/Perspex.Controls.csproj index 7510ce450c..2d9109a089 100644 --- a/src/Perspex.Controls/Perspex.Controls.csproj +++ b/src/Perspex.Controls/Perspex.Controls.csproj @@ -64,7 +64,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/src/Perspex.Controls/Presenters/DeckPresenter.cs b/src/Perspex.Controls/Presenters/CarouselPresenter.cs similarity index 91% rename from src/Perspex.Controls/Presenters/DeckPresenter.cs rename to src/Perspex.Controls/Presenters/CarouselPresenter.cs index 3a4c844d2a..4687740adb 100644 --- a/src/Perspex.Controls/Presenters/DeckPresenter.cs +++ b/src/Perspex.Controls/Presenters/CarouselPresenter.cs @@ -17,31 +17,31 @@ namespace Perspex.Controls.Presenters /// /// Displays pages inside an . /// - public class DeckPresenter : Control, IItemsPresenter + public class CarouselPresenter : Control, IItemsPresenter { /// /// Defines the property. /// public static readonly PerspexProperty ItemsProperty = - ItemsControl.ItemsProperty.AddOwner(o => o.Items, (o, v) => o.Items = v); + ItemsControl.ItemsProperty.AddOwner(o => o.Items, (o, v) => o.Items = v); /// /// Defines the property. /// public static readonly PerspexProperty> ItemsPanelProperty = - ItemsControl.ItemsPanelProperty.AddOwner(); + ItemsControl.ItemsPanelProperty.AddOwner(); /// /// Defines the property. /// public static readonly PerspexProperty MemberSelectorProperty = - ItemsControl.MemberSelectorProperty.AddOwner(); + ItemsControl.MemberSelectorProperty.AddOwner(); /// /// Defines the property. /// public static readonly PerspexProperty SelectedIndexProperty = - SelectingItemsControl.SelectedIndexProperty.AddOwner( + SelectingItemsControl.SelectedIndexProperty.AddOwner( o => o.SelectedIndex, (o, v) => o.SelectedIndex = v); @@ -49,7 +49,7 @@ namespace Perspex.Controls.Presenters /// Defines the property. /// public static readonly PerspexProperty TransitionProperty = - Deck.TransitionProperty.AddOwner(); + Carousel.TransitionProperty.AddOwner(); private IEnumerable _items; private int _selectedIndex = -1; @@ -57,11 +57,11 @@ namespace Perspex.Controls.Presenters private IItemContainerGenerator _generator; /// - /// Initializes static members of the class. + /// Initializes static members of the class. /// - static DeckPresenter() + static CarouselPresenter() { - SelectedIndexProperty.Changed.AddClassHandler(x => x.SelectedIndexChanged); + SelectedIndexProperty.Changed.AddClassHandler(x => x.SelectedIndexChanged); } /// diff --git a/src/Perspex.Controls/TabControl.cs b/src/Perspex.Controls/TabControl.cs index fa0ae06f4b..3974fe2533 100644 --- a/src/Perspex.Controls/TabControl.cs +++ b/src/Perspex.Controls/TabControl.cs @@ -23,7 +23,7 @@ namespace Perspex.Controls /// Defines the property. /// public static readonly PerspexProperty TransitionProperty = - Deck.TransitionProperty.AddOwner(); + Carousel.TransitionProperty.AddOwner(); private static readonly IMemberSelector s_contentSelector = new FuncMemberSelector(SelectContent); @@ -74,7 +74,7 @@ namespace Perspex.Controls /// bool IReparentingHost.WillReparentChildrenOf(IControl control) { - return control is DeckPresenter; + return control is CarouselPresenter; } /// diff --git a/src/Perspex.Themes.Default/DeckStyle.cs b/src/Perspex.Themes.Default/CarouselStyle.cs similarity index 63% rename from src/Perspex.Themes.Default/DeckStyle.cs rename to src/Perspex.Themes.Default/CarouselStyle.cs index 73868b2e7b..aa1f66e5f0 100644 --- a/src/Perspex.Themes.Default/DeckStyle.cs +++ b/src/Perspex.Themes.Default/CarouselStyle.cs @@ -11,42 +11,42 @@ using Perspex.Styling; namespace Perspex.Themes.Default { /// - /// The default style for the control. + /// The default style for the control. /// - public class DeckStyle : Styles + public class CarouselStyle : Styles { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public DeckStyle() + public CarouselStyle() { AddRange(new[] { - new Style(x => x.OfType()) + new Style(x => x.OfType()) { Setters = new[] { - new Setter(TemplatedControl.TemplateProperty, new ControlTemplate(Template)), + new Setter(TemplatedControl.TemplateProperty, new ControlTemplate(Template)), }, }, }); } /// - /// The default template for the control. + /// The default template for the control. /// /// The control being styled. /// The root of the instantiated template. - public static Control Template(Deck control) + public static Control Template(Carousel control) { - return new DeckPresenter + return new CarouselPresenter { Name = "itemsPresenter", MemberSelector = control.MemberSelector, [~ItemsPresenter.ItemsProperty] = control[~ItemsControl.ItemsProperty], [~ItemsPresenter.ItemsPanelProperty] = control[~ItemsControl.ItemsPanelProperty], - [~DeckPresenter.SelectedIndexProperty] = control[~SelectingItemsControl.SelectedIndexProperty], - [~DeckPresenter.TransitionProperty] = control[~Deck.TransitionProperty], + [~CarouselPresenter.SelectedIndexProperty] = control[~SelectingItemsControl.SelectedIndexProperty], + [~CarouselPresenter.TransitionProperty] = control[~Carousel.TransitionProperty], }; } } diff --git a/src/Perspex.Themes.Default/DefaultTheme.cs b/src/Perspex.Themes.Default/DefaultTheme.cs index d0c6c51ca7..8df75d1a91 100644 --- a/src/Perspex.Themes.Default/DefaultTheme.cs +++ b/src/Perspex.Themes.Default/DefaultTheme.cs @@ -20,7 +20,7 @@ namespace Perspex.Themes.Default Add(new ButtonStyle()); Add(new CheckBoxStyle()); Add(new ContentControlStyle()); - Add(new DeckStyle()); + Add(new CarouselStyle()); Add(new DropDownStyle()); Add(new GridSplitterStyle()); Add(new ItemsControlStyle()); diff --git a/src/Perspex.Themes.Default/Perspex.Themes.Default.csproj b/src/Perspex.Themes.Default/Perspex.Themes.Default.csproj index 4c6218f1b9..ae6b8ae086 100644 --- a/src/Perspex.Themes.Default/Perspex.Themes.Default.csproj +++ b/src/Perspex.Themes.Default/Perspex.Themes.Default.csproj @@ -82,7 +82,7 @@ - + diff --git a/src/Perspex.Themes.Default/TabControlStyle.cs b/src/Perspex.Themes.Default/TabControlStyle.cs index ab04a1fddb..253f0e1e28 100644 --- a/src/Perspex.Themes.Default/TabControlStyle.cs +++ b/src/Perspex.Themes.Default/TabControlStyle.cs @@ -56,13 +56,13 @@ namespace Perspex.Themes.Default [!ItemsControl.ItemsProperty] = control[!ItemsControl.ItemsProperty], [!!SelectingItemsControl.SelectedItemProperty] = control[!!SelectingItemsControl.SelectedItemProperty], }, - new Deck + new Carousel { - Name = "deck", + Name = "carousel", MemberSelector = new FuncMemberSelector(x => x.Content), - [!Deck.ItemsProperty] = control[!ItemsControl.ItemsProperty], - [!Deck.SelectedItemProperty] = control[!SelectingItemsControl.SelectedItemProperty], - [~Deck.TransitionProperty] = control[~TabControl.TransitionProperty], + [!Carousel.ItemsProperty] = control[!ItemsControl.ItemsProperty], + [!Carousel.SelectedItemProperty] = control[!SelectingItemsControl.SelectedItemProperty], + [~Carousel.TransitionProperty] = control[~TabControl.TransitionProperty], [Grid.RowProperty] = 1, } } diff --git a/tests/Perspex.Controls.UnitTests/DeckTests.cs b/tests/Perspex.Controls.UnitTests/CarouselTests.cs similarity index 73% rename from tests/Perspex.Controls.UnitTests/DeckTests.cs rename to tests/Perspex.Controls.UnitTests/CarouselTests.cs index 7a8d20c2d4..250aac3a44 100644 --- a/tests/Perspex.Controls.UnitTests/DeckTests.cs +++ b/tests/Perspex.Controls.UnitTests/CarouselTests.cs @@ -10,14 +10,14 @@ using Xunit; namespace Perspex.Controls.UnitTests { - public class DeckTests + public class CarouselTests { [Fact] public void First_Item_Should_Be_Selected_By_Default() { - var target = new Deck + var target = new Carousel { - Template = new ControlTemplate(CreateTemplate), + Template = new ControlTemplate(CreateTemplate), Items = new[] { "Foo", @@ -34,9 +34,9 @@ namespace Perspex.Controls.UnitTests [Fact] public void LogicalChild_Should_Be_Selected_Item() { - var target = new Deck + var target = new Carousel { - Template = new ControlTemplate(CreateTemplate), + Template = new ControlTemplate(CreateTemplate), Items = new[] { "Foo", @@ -53,15 +53,15 @@ namespace Perspex.Controls.UnitTests Assert.Equal("Foo", ((TextBlock)child).Text); } - private Control CreateTemplate(Deck control) + private Control CreateTemplate(Carousel control) { - return new DeckPresenter + return new CarouselPresenter { Name = "itemsPresenter", [~ItemsPresenter.ItemsProperty] = control[~ItemsControl.ItemsProperty], [~ItemsPresenter.ItemsPanelProperty] = control[~ItemsControl.ItemsPanelProperty], - [~DeckPresenter.SelectedIndexProperty] = control[~SelectingItemsControl.SelectedIndexProperty], - [~DeckPresenter.TransitionProperty] = control[~Deck.TransitionProperty], + [~CarouselPresenter.SelectedIndexProperty] = control[~SelectingItemsControl.SelectedIndexProperty], + [~CarouselPresenter.TransitionProperty] = control[~Carousel.TransitionProperty], }; } } diff --git a/tests/Perspex.Controls.UnitTests/Perspex.Controls.UnitTests.csproj b/tests/Perspex.Controls.UnitTests/Perspex.Controls.UnitTests.csproj index 63876a822a..a66afeedc2 100644 --- a/tests/Perspex.Controls.UnitTests/Perspex.Controls.UnitTests.csproj +++ b/tests/Perspex.Controls.UnitTests/Perspex.Controls.UnitTests.csproj @@ -92,7 +92,7 @@ - + @@ -105,7 +105,7 @@ - + diff --git a/tests/Perspex.Controls.UnitTests/Presenters/DeckPresenterTests.cs b/tests/Perspex.Controls.UnitTests/Presenters/CarouselPresenterTests.cs similarity index 90% rename from tests/Perspex.Controls.UnitTests/Presenters/DeckPresenterTests.cs rename to tests/Perspex.Controls.UnitTests/Presenters/CarouselPresenterTests.cs index 88f5a179b5..4ce53c6142 100644 --- a/tests/Perspex.Controls.UnitTests/Presenters/DeckPresenterTests.cs +++ b/tests/Perspex.Controls.UnitTests/Presenters/CarouselPresenterTests.cs @@ -8,12 +8,12 @@ using Xunit; namespace Perspex.Controls.UnitTests.Presenters { - public class DeckPresenterTests + public class CarouselPresenterTests { [Fact] public void ApplyTemplate_Should_Create_Panel() { - var target = new DeckPresenter + var target = new CarouselPresenter { ItemsPanel = new FuncTemplate(() => new Panel()), }; @@ -27,7 +27,7 @@ namespace Perspex.Controls.UnitTests.Presenters public void ItemContainerGenerator_Should_Be_Picked_Up_From_TemplatedControl() { var parent = new TestItemsControl(); - var target = new DeckPresenter + var target = new CarouselPresenter { TemplatedParent = parent, }; @@ -38,7 +38,7 @@ namespace Perspex.Controls.UnitTests.Presenters [Fact] public void Setting_SelectedIndex_Should_Show_Page() { - var target = new DeckPresenter + var target = new CarouselPresenter { Items = new[] { "foo", "bar" }, SelectedIndex = 0, @@ -53,7 +53,7 @@ namespace Perspex.Controls.UnitTests.Presenters [Fact] public void Changing_SelectedIndex_Should_Show_Page() { - var target = new DeckPresenter + var target = new CarouselPresenter { Items = new[] { "foo", "bar" }, SelectedIndex = 0, diff --git a/tests/Perspex.Controls.UnitTests/TabControlTests.cs b/tests/Perspex.Controls.UnitTests/TabControlTests.cs index 3bce41a515..09f1dd6b9a 100644 --- a/tests/Perspex.Controls.UnitTests/TabControlTests.cs +++ b/tests/Perspex.Controls.UnitTests/TabControlTests.cs @@ -188,10 +188,10 @@ namespace Perspex.Controls.UnitTests [!ItemsControl.ItemsProperty] = parent[!ItemsControl.ItemsProperty], [!!TabStrip.SelectedTabProperty] = parent[!!TabControl.SelectedTabProperty] }, - new Deck + new Carousel { - Name = "deck", - Template = new ControlTemplate(CreateDeckTemplate), + Name = "carousel", + Template = new ControlTemplate(CreateCarouselTemplate), MemberSelector = parent.ContentSelector, [!ItemsControl.ItemsProperty] = parent[!ItemsControl.ItemsProperty], [!SelectingItemsControl.SelectedItemProperty] = parent[!SelectingItemsControl.SelectedItemProperty], @@ -209,16 +209,16 @@ namespace Perspex.Controls.UnitTests }; } - private Control CreateDeckTemplate(Deck control) + private Control CreateCarouselTemplate(Carousel control) { - return new DeckPresenter + return new CarouselPresenter { Name = "itemsPresenter", - [!DeckPresenter.ItemsProperty] = control[!ItemsControl.ItemsProperty], - [!DeckPresenter.ItemsPanelProperty] = control[!ItemsControl.ItemsPanelProperty], - [!DeckPresenter.MemberSelectorProperty] = control[!ItemsControl.MemberSelectorProperty], - [!DeckPresenter.SelectedIndexProperty] = control[!SelectingItemsControl.SelectedIndexProperty], - [~DeckPresenter.TransitionProperty] = control[~Deck.TransitionProperty], + [!CarouselPresenter.ItemsProperty] = control[!ItemsControl.ItemsProperty], + [!CarouselPresenter.ItemsPanelProperty] = control[!ItemsControl.ItemsPanelProperty], + [!CarouselPresenter.MemberSelectorProperty] = control[!ItemsControl.MemberSelectorProperty], + [!CarouselPresenter.SelectedIndexProperty] = control[!SelectingItemsControl.SelectedIndexProperty], + [~CarouselPresenter.TransitionProperty] = control[~Carousel.TransitionProperty], }; }