From 1202eaa87697dd994b68ba73f8066a6031429c99 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 29 Jan 2016 15:57:20 +0100 Subject: [PATCH] Updated PerspexProperties to new classes i.e. AttachedProperty, DirectProperty or StyledProperty. --- src/Perspex.Application/Designer/Design.cs | 8 +++---- src/Perspex.Controls/Canvas.cs | 8 +++---- src/Perspex.Controls/ColumnDefinition.cs | 6 ++--- src/Perspex.Controls/Control.cs | 10 ++++----- src/Perspex.Controls/DefinitionBase.cs | 2 +- src/Perspex.Controls/DockPanel.cs | 4 ++-- src/Perspex.Controls/DropDown.cs | 4 ++-- src/Perspex.Controls/Expander.cs | 6 ++--- src/Perspex.Controls/Grid.cs | 8 +++---- src/Perspex.Controls/GridSplitter.cs | 2 +- src/Perspex.Controls/Image.cs | 4 ++-- src/Perspex.Controls/Menu.cs | 2 +- src/Perspex.Controls/MenuItem.cs | 2 +- src/Perspex.Controls/NameScope.cs | 2 +- src/Perspex.Controls/Panel.cs | 2 +- .../Presenters/CarouselPresenter.cs | 10 ++++----- .../Presenters/ContentPresenter.cs | 4 ++-- .../Presenters/ItemsPresenter.cs | 7 +++--- .../Presenters/TextPresenter.cs | 4 ++-- src/Perspex.Controls/Primitives/AccessText.cs | 3 +-- .../Primitives/AdornerLayer.cs | 4 ++-- .../Primitives/HeaderedItemsControl.cs | 2 +- .../Primitives/HeaderedSelectingControl.cs | 2 +- src/Perspex.Controls/Primitives/Popup.cs | 10 ++++----- .../Primitives/TemplatedControl.cs | 2 +- .../Primitives/ToggleButton.cs | 2 +- src/Perspex.Controls/Primitives/Track.cs | 12 +++++----- src/Perspex.Controls/RowDefinition.cs | 6 ++--- src/Perspex.Controls/Shapes/Path.cs | 2 +- src/Perspex.Controls/Shapes/Shape.cs | 10 ++++----- src/Perspex.Controls/StackPanel.cs | 4 ++-- src/Perspex.Controls/TabControl.cs | 4 ++-- src/Perspex.Controls/TabItem.cs | 2 +- src/Perspex.Controls/ToolTip.cs | 2 +- src/Perspex.Controls/TopLevel.cs | 6 ++--- src/Perspex.Controls/TreeView.cs | 4 ++-- src/Perspex.Controls/TreeViewItem.cs | 4 ++-- src/Perspex.Controls/Window.cs | 6 ++--- src/Perspex.Controls/WrapPanel.cs | 2 +- .../Views/ControlDetailsView.cs | 2 +- src/Perspex.Diagnostics/Views/GridRepeater.cs | 4 ++-- src/Perspex.Input/KeyBinding.cs | 4 ++-- src/Perspex.Layout/Layoutable.cs | 22 +++++++++---------- src/Perspex.SceneGraph/Media/Brush.cs | 2 +- src/Perspex.SceneGraph/Media/Geometry.cs | 2 +- src/Perspex.SceneGraph/Media/GradientBrush.cs | 4 ++-- src/Perspex.SceneGraph/Media/ImageBush.cs | 2 +- .../Media/LinearGradientBrush.cs | 4 ++-- .../Media/MatrixTransform.cs | 2 +- .../Media/RadialGradientBrush.cs | 6 ++--- .../Media/RotateTransform.cs | 2 +- src/Perspex.SceneGraph/Media/TileBrush.cs | 12 +++++----- .../Media/TranslateTransform.cs | 4 ++-- src/Perspex.SceneGraph/Media/VisualBrush.cs | 2 +- .../PerspexObjectTests_Binding.cs | 8 +++---- .../PerspexObjectTests_Direct.cs | 2 +- .../PerspexObjectTests_GetObservable.cs | 4 ++-- .../PerspexObjectTests_GetSubject.cs | 2 +- .../PerspexObjectTests_Metadata.cs | 14 ++++++------ .../PerspexObjectTests_SetValue.cs | 8 +++---- .../PerspexPropertyRegistryTests.cs | 12 +++++----- .../PerspexPropertyTests.cs | 2 +- .../StyledPropertyTests.cs | 2 +- .../Mixins/SelectableMixinTests.cs | 2 +- tests/Perspex.LeakTests/ControlTests.cs | 2 +- ...ExpressionObserverTests_PerspexProperty.cs | 2 +- .../PerspexPropertyConverterTest.cs | 4 ++-- .../Data/BindingTests.cs | 4 ++-- .../SamplePerspexObject.cs | 4 ++-- .../ActivatedSubjectTests.cs | 2 +- tests/Perspex.Styling.UnitTests/StyleTests.cs | 2 +- 71 files changed, 166 insertions(+), 168 deletions(-) diff --git a/src/Perspex.Application/Designer/Design.cs b/src/Perspex.Application/Designer/Design.cs index d27646d6c7..380d1939b0 100644 --- a/src/Perspex.Application/Designer/Design.cs +++ b/src/Perspex.Application/Designer/Design.cs @@ -11,7 +11,7 @@ namespace Perspex { public static bool IsDesignMode { get; internal set; } - public static readonly PerspexProperty HeightProperty = PerspexProperty + public static readonly AttachedProperty HeightProperty = PerspexProperty .RegisterAttached("Height", typeof (Design)); public static void SetHeight(Control control, double value) @@ -24,8 +24,8 @@ namespace Perspex return control.GetValue(HeightProperty); } - public static readonly PerspexProperty WidthProperty = PerspexProperty - .RegisterAttached("Width", typeof(Design)); + public static readonly AttachedProperty WidthProperty = PerspexProperty + .RegisterAttached("Width", typeof(Design)); public static void SetWidth(Control control, double value) { @@ -37,7 +37,7 @@ namespace Perspex return control.GetValue(WidthProperty); } - public static readonly PerspexProperty DataContextProperty = PerspexProperty + public static readonly AttachedProperty DataContextProperty = PerspexProperty .RegisterAttached("DataContext", typeof (Design)); public static void SetDataContext(Control control, object value) diff --git a/src/Perspex.Controls/Canvas.cs b/src/Perspex.Controls/Canvas.cs index 3e4612e663..8d39568f95 100644 --- a/src/Perspex.Controls/Canvas.cs +++ b/src/Perspex.Controls/Canvas.cs @@ -20,25 +20,25 @@ namespace Perspex.Controls /// /// Defines the Left attached property. /// - public static readonly PerspexProperty LeftProperty = + public static readonly AttachedProperty LeftProperty = PerspexProperty.RegisterAttached("Left"); /// /// Defines the Top attached property. /// - public static readonly PerspexProperty TopProperty = + public static readonly AttachedProperty TopProperty = PerspexProperty.RegisterAttached("Top"); /// /// Defines the Right attached property. /// - public static readonly PerspexProperty RightProperty = + public static readonly AttachedProperty RightProperty = PerspexProperty.RegisterAttached("Right"); /// /// Defines the Bottom attached property. /// - public static readonly PerspexProperty BottomProperty = + public static readonly AttachedProperty BottomProperty = PerspexProperty.RegisterAttached("Bottom"); /// diff --git a/src/Perspex.Controls/ColumnDefinition.cs b/src/Perspex.Controls/ColumnDefinition.cs index 747c2d3d78..8b49c1f710 100644 --- a/src/Perspex.Controls/ColumnDefinition.cs +++ b/src/Perspex.Controls/ColumnDefinition.cs @@ -11,19 +11,19 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty MaxWidthProperty = + public static readonly StyledProperty MaxWidthProperty = PerspexProperty.Register("MaxWidth", double.PositiveInfinity); /// /// Defines the property. /// - public static readonly PerspexProperty MinWidthProperty = + public static readonly StyledProperty MinWidthProperty = PerspexProperty.Register("MinWidth"); /// /// Defines the property. /// - public static readonly PerspexProperty WidthProperty = + public static readonly StyledProperty WidthProperty = PerspexProperty.Register("Width", new GridLength(1, GridUnitType.Star)); /// diff --git a/src/Perspex.Controls/Control.cs b/src/Perspex.Controls/Control.cs index 730e7d8f33..3a14987c50 100644 --- a/src/Perspex.Controls/Control.cs +++ b/src/Perspex.Controls/Control.cs @@ -35,7 +35,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty DataContextProperty = + public static readonly StyledProperty DataContextProperty = PerspexProperty.Register( nameof(DataContext), inherits: true, @@ -44,25 +44,25 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty> FocusAdornerProperty = + public static readonly StyledProperty> FocusAdornerProperty = PerspexProperty.Register>(nameof(FocusAdorner)); /// /// Defines the property. /// - public static readonly PerspexProperty ParentProperty = + public static readonly DirectProperty ParentProperty = PerspexProperty.RegisterDirect(nameof(Parent), o => o.Parent); /// /// Defines the property. /// - public static readonly PerspexProperty TagProperty = + public static readonly StyledProperty TagProperty = PerspexProperty.Register(nameof(Tag)); /// /// Defines the property. /// - public static readonly PerspexProperty TemplatedParentProperty = + public static readonly StyledProperty TemplatedParentProperty = PerspexProperty.Register(nameof(TemplatedParent), inherits: true); /// diff --git a/src/Perspex.Controls/DefinitionBase.cs b/src/Perspex.Controls/DefinitionBase.cs index 010009850f..e0ef5677cb 100644 --- a/src/Perspex.Controls/DefinitionBase.cs +++ b/src/Perspex.Controls/DefinitionBase.cs @@ -11,7 +11,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty SharedSizeGroupProperty = + public static readonly StyledProperty SharedSizeGroupProperty = PerspexProperty.Register(nameof(SharedSizeGroup), inherits: true); /// diff --git a/src/Perspex.Controls/DockPanel.cs b/src/Perspex.Controls/DockPanel.cs index 8108a8c3cb..d268489799 100644 --- a/src/Perspex.Controls/DockPanel.cs +++ b/src/Perspex.Controls/DockPanel.cs @@ -21,13 +21,13 @@ /// /// Defines the Dock attached property. /// - public static readonly PerspexProperty DockProperty = + public static readonly AttachedProperty DockProperty = PerspexProperty.RegisterAttached("Dock"); /// /// Defines the property. /// - public static readonly PerspexProperty LastChildFillProperty = + public static readonly StyledProperty LastChildFillProperty = PerspexProperty.Register( nameof(LastChildFillProperty), defaultValue: true); diff --git a/src/Perspex.Controls/DropDown.cs b/src/Perspex.Controls/DropDown.cs index 8742016d9c..ed6ba1072f 100644 --- a/src/Perspex.Controls/DropDown.cs +++ b/src/Perspex.Controls/DropDown.cs @@ -21,7 +21,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty IsDropDownOpenProperty = + public static readonly DirectProperty IsDropDownOpenProperty = PerspexProperty.RegisterDirect( nameof(IsDropDownOpen), o => o.IsDropDownOpen, @@ -30,7 +30,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty SelectionBoxItemProperty = + public static readonly DirectProperty SelectionBoxItemProperty = PerspexProperty.RegisterDirect("SelectionBoxItem", o => o.SelectionBoxItem); private bool _isDropDownOpen; diff --git a/src/Perspex.Controls/Expander.cs b/src/Perspex.Controls/Expander.cs index 5ac926af47..523976d596 100644 --- a/src/Perspex.Controls/Expander.cs +++ b/src/Perspex.Controls/Expander.cs @@ -13,13 +13,13 @@ namespace Perspex.Controls public class Expander : HeaderedContentControl { - public static readonly PerspexProperty IsExpandedProperty = + public static readonly StyledProperty IsExpandedProperty = PerspexProperty.Register(nameof(IsExpanded), true); - public static readonly PerspexProperty ExpandDirectionProperty = + public static readonly StyledProperty ExpandDirectionProperty = PerspexProperty.Register(nameof(ExpandDirection), ExpandDirection.Down); - public static readonly PerspexProperty ContentTransitionProperty = + public static readonly StyledProperty ContentTransitionProperty = PerspexProperty.Register(nameof(ContentTransition)); static Expander() diff --git a/src/Perspex.Controls/Grid.cs b/src/Perspex.Controls/Grid.cs index 1c848f6887..dc25d29262 100644 --- a/src/Perspex.Controls/Grid.cs +++ b/src/Perspex.Controls/Grid.cs @@ -16,7 +16,7 @@ namespace Perspex.Controls /// /// Defines the Column attached property. /// - public static readonly PerspexProperty ColumnProperty = + public static readonly AttachedProperty ColumnProperty = PerspexProperty.RegisterAttached( "Column", validate: ValidateColumn); @@ -24,13 +24,13 @@ namespace Perspex.Controls /// /// Defines the ColumnSpan attached property. /// - public static readonly PerspexProperty ColumnSpanProperty = + public static readonly AttachedProperty ColumnSpanProperty = PerspexProperty.RegisterAttached("ColumnSpan", 1); /// /// Defines the Row attached property. /// - public static readonly PerspexProperty RowProperty = + public static readonly AttachedProperty RowProperty = PerspexProperty.RegisterAttached( "Row", validate: ValidateRow); @@ -38,7 +38,7 @@ namespace Perspex.Controls /// /// Defines the RowSpan attached property. /// - public static readonly PerspexProperty RowSpanProperty = + public static readonly AttachedProperty RowSpanProperty = PerspexProperty.RegisterAttached("RowSpan", 1); private ColumnDefinitions _columnDefinitions; diff --git a/src/Perspex.Controls/GridSplitter.cs b/src/Perspex.Controls/GridSplitter.cs index 57d77e8f8d..efb50c3e72 100644 --- a/src/Perspex.Controls/GridSplitter.cs +++ b/src/Perspex.Controls/GridSplitter.cs @@ -23,7 +23,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty OrientationProperty = + public static readonly StyledProperty OrientationProperty = PerspexProperty.Register(nameof(Orientation)); protected Grid _grid; diff --git a/src/Perspex.Controls/Image.cs b/src/Perspex.Controls/Image.cs index 26dc930a06..f87643fb3f 100644 --- a/src/Perspex.Controls/Image.cs +++ b/src/Perspex.Controls/Image.cs @@ -15,13 +15,13 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty SourceProperty = + public static readonly StyledProperty SourceProperty = PerspexProperty.Register(nameof(Source)); /// /// Defines the property. /// - public static readonly PerspexProperty StretchProperty = + public static readonly StyledProperty StretchProperty = PerspexProperty.Register(nameof(Stretch), Stretch.Uniform); /// diff --git a/src/Perspex.Controls/Menu.cs b/src/Perspex.Controls/Menu.cs index 2abe65ae48..682789be8e 100644 --- a/src/Perspex.Controls/Menu.cs +++ b/src/Perspex.Controls/Menu.cs @@ -27,7 +27,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty IsOpenProperty = + public static readonly DirectProperty IsOpenProperty = PerspexProperty.RegisterDirect( nameof(IsOpen), o => o.IsOpen); diff --git a/src/Perspex.Controls/MenuItem.cs b/src/Perspex.Controls/MenuItem.cs index 98c104b478..ad03a1303f 100644 --- a/src/Perspex.Controls/MenuItem.cs +++ b/src/Perspex.Controls/MenuItem.cs @@ -51,7 +51,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty IsSubMenuOpenProperty = + public static readonly StyledProperty IsSubMenuOpenProperty = PerspexProperty.Register(nameof(IsSubMenuOpen)); /// diff --git a/src/Perspex.Controls/NameScope.cs b/src/Perspex.Controls/NameScope.cs index ab64733a4b..b01fe5a142 100644 --- a/src/Perspex.Controls/NameScope.cs +++ b/src/Perspex.Controls/NameScope.cs @@ -14,7 +14,7 @@ namespace Perspex.Controls /// /// Defines the NameScope attached property. /// - public static readonly PerspexProperty NameScopeProperty = + public static readonly AttachedProperty NameScopeProperty = PerspexProperty.RegisterAttached("NameScope"); private readonly Dictionary _inner = new Dictionary(); diff --git a/src/Perspex.Controls/Panel.cs b/src/Perspex.Controls/Panel.cs index edb110f22d..fc80cc1656 100644 --- a/src/Perspex.Controls/Panel.cs +++ b/src/Perspex.Controls/Panel.cs @@ -22,7 +22,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty BackgroundProperty = + public static readonly StyledProperty BackgroundProperty = Border.BackgroundProperty.AddOwner(); private readonly Controls _children = new Controls(); diff --git a/src/Perspex.Controls/Presenters/CarouselPresenter.cs b/src/Perspex.Controls/Presenters/CarouselPresenter.cs index 6662210288..f5e16851e2 100644 --- a/src/Perspex.Controls/Presenters/CarouselPresenter.cs +++ b/src/Perspex.Controls/Presenters/CarouselPresenter.cs @@ -22,25 +22,25 @@ namespace Perspex.Controls.Presenters /// /// Defines the property. /// - public static readonly PerspexProperty ItemsProperty = + public static readonly DirectProperty ItemsProperty = ItemsControl.ItemsProperty.AddOwner(o => o.Items, (o, v) => o.Items = v); /// /// Defines the property. /// - public static readonly PerspexProperty> ItemsPanelProperty = + public static readonly StyledProperty> ItemsPanelProperty = ItemsControl.ItemsPanelProperty.AddOwner(); /// /// Defines the property. /// - public static readonly PerspexProperty MemberSelectorProperty = + public static readonly StyledProperty MemberSelectorProperty = ItemsControl.MemberSelectorProperty.AddOwner(); /// /// Defines the property. /// - public static readonly PerspexProperty SelectedIndexProperty = + public static readonly DirectProperty SelectedIndexProperty = SelectingItemsControl.SelectedIndexProperty.AddOwner( o => o.SelectedIndex, (o, v) => o.SelectedIndex = v); @@ -48,7 +48,7 @@ namespace Perspex.Controls.Presenters /// /// Defines the property. /// - public static readonly PerspexProperty TransitionProperty = + public static readonly StyledProperty TransitionProperty = Carousel.TransitionProperty.AddOwner(); private IEnumerable _items; diff --git a/src/Perspex.Controls/Presenters/ContentPresenter.cs b/src/Perspex.Controls/Presenters/ContentPresenter.cs index 223dca8088..23cd87d5dd 100644 --- a/src/Perspex.Controls/Presenters/ContentPresenter.cs +++ b/src/Perspex.Controls/Presenters/ContentPresenter.cs @@ -14,7 +14,7 @@ namespace Perspex.Controls.Presenters /// /// Defines the property. /// - public static readonly PerspexProperty ChildProperty = + public static readonly DirectProperty ChildProperty = PerspexProperty.RegisterDirect( nameof(Child), o => o.Child); @@ -22,7 +22,7 @@ namespace Perspex.Controls.Presenters /// /// Defines the property. /// - public static readonly PerspexProperty ContentProperty = + public static readonly StyledProperty ContentProperty = ContentControl.ContentProperty.AddOwner(); private IControl _child; diff --git a/src/Perspex.Controls/Presenters/ItemsPresenter.cs b/src/Perspex.Controls/Presenters/ItemsPresenter.cs index c2eb692b7a..29e796fd75 100644 --- a/src/Perspex.Controls/Presenters/ItemsPresenter.cs +++ b/src/Perspex.Controls/Presenters/ItemsPresenter.cs @@ -5,7 +5,6 @@ using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; -using System.Linq; using Perspex.Controls.Generators; using Perspex.Controls.Templates; using Perspex.Input; @@ -21,19 +20,19 @@ namespace Perspex.Controls.Presenters /// /// Defines the property. /// - public static readonly PerspexProperty ItemsProperty = + public static readonly DirectProperty ItemsProperty = ItemsControl.ItemsProperty.AddOwner(o => o.Items, (o, v) => o.Items = v); /// /// Defines the property. /// - public static readonly PerspexProperty> ItemsPanelProperty = + public static readonly StyledProperty> ItemsPanelProperty = ItemsControl.ItemsPanelProperty.AddOwner(); /// /// Defines the property. /// - public static readonly PerspexProperty MemberSelectorProperty = + public static readonly StyledProperty MemberSelectorProperty = ItemsControl.MemberSelectorProperty.AddOwner(); private IEnumerable _items; diff --git a/src/Perspex.Controls/Presenters/TextPresenter.cs b/src/Perspex.Controls/Presenters/TextPresenter.cs index aa31625539..625d58d9dd 100644 --- a/src/Perspex.Controls/Presenters/TextPresenter.cs +++ b/src/Perspex.Controls/Presenters/TextPresenter.cs @@ -15,10 +15,10 @@ namespace Perspex.Controls.Presenters public static readonly StyledProperty CaretIndexProperty = TextBox.CaretIndexProperty.AddOwner(); - public static readonly PerspexProperty SelectionStartProperty = + public static readonly StyledProperty SelectionStartProperty = TextBox.SelectionStartProperty.AddOwner(); - public static readonly PerspexProperty SelectionEndProperty = + public static readonly StyledProperty SelectionEndProperty = TextBox.SelectionEndProperty.AddOwner(); private readonly DispatcherTimer _caretTimer; diff --git a/src/Perspex.Controls/Primitives/AccessText.cs b/src/Perspex.Controls/Primitives/AccessText.cs index 38dab95803..0205238aca 100644 --- a/src/Perspex.Controls/Primitives/AccessText.cs +++ b/src/Perspex.Controls/Primitives/AccessText.cs @@ -4,7 +4,6 @@ using System; using Perspex.Input; using Perspex.Media; -using Perspex.Rendering; namespace Perspex.Controls.Primitives { @@ -16,7 +15,7 @@ namespace Perspex.Controls.Primitives /// /// Defines the attached property. /// - public static readonly PerspexProperty ShowAccessKeyProperty = + public static readonly AttachedProperty ShowAccessKeyProperty = PerspexProperty.RegisterAttached("ShowAccessKey", inherits: true); /// diff --git a/src/Perspex.Controls/Primitives/AdornerLayer.cs b/src/Perspex.Controls/Primitives/AdornerLayer.cs index 138df92f4b..b7e33c3391 100644 --- a/src/Perspex.Controls/Primitives/AdornerLayer.cs +++ b/src/Perspex.Controls/Primitives/AdornerLayer.cs @@ -11,10 +11,10 @@ namespace Perspex.Controls.Primitives // TODO: Need to track position of adorned elements and move the adorner if they move. public class AdornerLayer : Panel { - public static PerspexProperty AdornedElementProperty = + public static AttachedProperty AdornedElementProperty = PerspexProperty.RegisterAttached("AdornedElement"); - private static readonly PerspexProperty s_adornedElementInfoProperty = + private static readonly AttachedProperty s_adornedElementInfoProperty = PerspexProperty.RegisterAttached("AdornedElementInfo"); private readonly BoundsTracker _tracker = new BoundsTracker(); diff --git a/src/Perspex.Controls/Primitives/HeaderedItemsControl.cs b/src/Perspex.Controls/Primitives/HeaderedItemsControl.cs index 47d714e4da..62f92dc0f6 100644 --- a/src/Perspex.Controls/Primitives/HeaderedItemsControl.cs +++ b/src/Perspex.Controls/Primitives/HeaderedItemsControl.cs @@ -16,7 +16,7 @@ namespace Perspex.Controls.Primitives /// /// Defines the property. /// - public static readonly PerspexProperty HeaderProperty = + public static readonly StyledProperty HeaderProperty = HeaderedContentControl.HeaderProperty.AddOwner(); /// diff --git a/src/Perspex.Controls/Primitives/HeaderedSelectingControl.cs b/src/Perspex.Controls/Primitives/HeaderedSelectingControl.cs index eb513d25f5..e41bb617ff 100644 --- a/src/Perspex.Controls/Primitives/HeaderedSelectingControl.cs +++ b/src/Perspex.Controls/Primitives/HeaderedSelectingControl.cs @@ -14,7 +14,7 @@ namespace Perspex.Controls.Primitives /// /// Defines the property. /// - public static readonly PerspexProperty HeaderProperty = + public static readonly StyledProperty HeaderProperty = HeaderedContentControl.HeaderProperty.AddOwner(); /// diff --git a/src/Perspex.Controls/Primitives/Popup.cs b/src/Perspex.Controls/Primitives/Popup.cs index ce409b4256..2c4dd05745 100644 --- a/src/Perspex.Controls/Primitives/Popup.cs +++ b/src/Perspex.Controls/Primitives/Popup.cs @@ -18,13 +18,13 @@ namespace Perspex.Controls.Primitives /// /// Defines the property. /// - public static readonly PerspexProperty ChildProperty = + public static readonly StyledProperty ChildProperty = PerspexProperty.Register(nameof(Child)); /// /// Defines the property. /// - public static readonly PerspexProperty IsOpenProperty = + public static readonly DirectProperty IsOpenProperty = PerspexProperty.RegisterDirect( nameof(IsOpen), o => o.IsOpen, @@ -33,19 +33,19 @@ namespace Perspex.Controls.Primitives /// /// Defines the property. /// - public static readonly PerspexProperty PlacementModeProperty = + public static readonly StyledProperty PlacementModeProperty = PerspexProperty.Register(nameof(PlacementMode), defaultValue: PlacementMode.Bottom); /// /// Defines the property. /// - public static readonly PerspexProperty PlacementTargetProperty = + public static readonly StyledProperty PlacementTargetProperty = PerspexProperty.Register(nameof(PlacementTarget)); /// /// Defines the property. /// - public static readonly PerspexProperty StaysOpenProperty = + public static readonly StyledProperty StaysOpenProperty = PerspexProperty.Register(nameof(StaysOpen), true); private bool _isOpen; diff --git a/src/Perspex.Controls/Primitives/TemplatedControl.cs b/src/Perspex.Controls/Primitives/TemplatedControl.cs index eb91dbf3f8..0941864ae4 100644 --- a/src/Perspex.Controls/Primitives/TemplatedControl.cs +++ b/src/Perspex.Controls/Primitives/TemplatedControl.cs @@ -71,7 +71,7 @@ namespace Perspex.Controls.Primitives /// /// Defines the property. /// - public static readonly PerspexProperty TemplateProperty = + public static readonly StyledProperty TemplateProperty = PerspexProperty.Register("Template"); /// diff --git a/src/Perspex.Controls/Primitives/ToggleButton.cs b/src/Perspex.Controls/Primitives/ToggleButton.cs index 744af915c0..8d464464ec 100644 --- a/src/Perspex.Controls/Primitives/ToggleButton.cs +++ b/src/Perspex.Controls/Primitives/ToggleButton.cs @@ -8,7 +8,7 @@ namespace Perspex.Controls.Primitives { public class ToggleButton : Button { - public static readonly PerspexProperty IsCheckedProperty = + public static readonly DirectProperty IsCheckedProperty = PerspexProperty.RegisterDirect( "IsChecked", o => o.IsChecked, diff --git a/src/Perspex.Controls/Primitives/Track.cs b/src/Perspex.Controls/Primitives/Track.cs index 238b633050..b3427cf12c 100644 --- a/src/Perspex.Controls/Primitives/Track.cs +++ b/src/Perspex.Controls/Primitives/Track.cs @@ -10,22 +10,22 @@ namespace Perspex.Controls.Primitives { public class Track : Control { - public static readonly PerspexProperty MinimumProperty = + public static readonly DirectProperty MinimumProperty = RangeBase.MinimumProperty.AddOwner(o => o.Minimum, (o,v) => o.Minimum = v); - public static readonly PerspexProperty MaximumProperty = + public static readonly DirectProperty MaximumProperty = RangeBase.MaximumProperty.AddOwner(o => o.Maximum, (o, v) => o.Maximum = v); - public static readonly PerspexProperty ValueProperty = + public static readonly DirectProperty ValueProperty = RangeBase.ValueProperty.AddOwner(o => o.Value, (o, v) => o.Value = v); - public static readonly PerspexProperty ViewportSizeProperty = + public static readonly StyledProperty ViewportSizeProperty = ScrollBar.ViewportSizeProperty.AddOwner(); - public static readonly PerspexProperty OrientationProperty = + public static readonly StyledProperty OrientationProperty = ScrollBar.OrientationProperty.AddOwner(); - public static readonly PerspexProperty ThumbProperty = + public static readonly StyledProperty ThumbProperty = PerspexProperty.Register("Thumb"); private double _minimum; diff --git a/src/Perspex.Controls/RowDefinition.cs b/src/Perspex.Controls/RowDefinition.cs index 73452d7723..fcc84dc8d6 100644 --- a/src/Perspex.Controls/RowDefinition.cs +++ b/src/Perspex.Controls/RowDefinition.cs @@ -11,19 +11,19 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty MaxHeightProperty = + public static readonly StyledProperty MaxHeightProperty = PerspexProperty.Register("MaxHeight", double.PositiveInfinity); /// /// Defines the property. /// - public static readonly PerspexProperty MinHeightProperty = + public static readonly StyledProperty MinHeightProperty = PerspexProperty.Register("MinHeight"); /// /// Defines the property. /// - public static readonly PerspexProperty HeightProperty = + public static readonly StyledProperty HeightProperty = PerspexProperty.Register("Height", new GridLength(1, GridUnitType.Star)); /// diff --git a/src/Perspex.Controls/Shapes/Path.cs b/src/Perspex.Controls/Shapes/Path.cs index dfb735f2c5..bee94c879b 100644 --- a/src/Perspex.Controls/Shapes/Path.cs +++ b/src/Perspex.Controls/Shapes/Path.cs @@ -8,7 +8,7 @@ namespace Perspex.Controls.Shapes { public class Path : Shape { - public static readonly PerspexProperty DataProperty = + public static readonly StyledProperty DataProperty = PerspexProperty.Register("Data"); public Geometry Data diff --git a/src/Perspex.Controls/Shapes/Shape.cs b/src/Perspex.Controls/Shapes/Shape.cs index 6e7934b0e7..3b11d816b9 100644 --- a/src/Perspex.Controls/Shapes/Shape.cs +++ b/src/Perspex.Controls/Shapes/Shape.cs @@ -10,19 +10,19 @@ namespace Perspex.Controls.Shapes { public abstract class Shape : Control { - public static readonly PerspexProperty FillProperty = + public static readonly StyledProperty FillProperty = PerspexProperty.Register("Fill"); - public static readonly PerspexProperty StretchProperty = + public static readonly StyledProperty StretchProperty = PerspexProperty.Register("Stretch"); - public static readonly PerspexProperty StrokeProperty = + public static readonly StyledProperty StrokeProperty = PerspexProperty.Register("Stroke"); - public static readonly PerspexProperty> StrokeDashArrayProperty = + public static readonly StyledProperty> StrokeDashArrayProperty = PerspexProperty.Register>("StrokeDashArray"); - public static readonly PerspexProperty StrokeThicknessProperty = + public static readonly StyledProperty StrokeThicknessProperty = PerspexProperty.Register("StrokeThickness"); private Matrix _transform = Matrix.Identity; diff --git a/src/Perspex.Controls/StackPanel.cs b/src/Perspex.Controls/StackPanel.cs index b40d2ecc7f..8dba4383f7 100644 --- a/src/Perspex.Controls/StackPanel.cs +++ b/src/Perspex.Controls/StackPanel.cs @@ -30,13 +30,13 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty GapProperty = + public static readonly StyledProperty GapProperty = PerspexProperty.Register(nameof(Gap)); /// /// Defines the property. /// - public static readonly PerspexProperty OrientationProperty = + public static readonly StyledProperty OrientationProperty = PerspexProperty.Register(nameof(Orientation)); /// diff --git a/src/Perspex.Controls/TabControl.cs b/src/Perspex.Controls/TabControl.cs index 86ca837a4e..f0a6069e15 100644 --- a/src/Perspex.Controls/TabControl.cs +++ b/src/Perspex.Controls/TabControl.cs @@ -16,7 +16,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty TransitionProperty = + public static readonly StyledProperty TransitionProperty = Perspex.Controls.Carousel.TransitionProperty.AddOwner(); /// @@ -34,7 +34,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty TabStripPlacementProperty = + public static readonly StyledProperty TabStripPlacementProperty = PerspexProperty.Register(nameof(TabStripPlacement), defaultValue: Dock.Top); /// diff --git a/src/Perspex.Controls/TabItem.cs b/src/Perspex.Controls/TabItem.cs index 0b153dcfe8..1903f86052 100644 --- a/src/Perspex.Controls/TabItem.cs +++ b/src/Perspex.Controls/TabItem.cs @@ -14,7 +14,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty IsSelectedProperty = + public static readonly StyledProperty IsSelectedProperty = ListBoxItem.IsSelectedProperty.AddOwner(); /// diff --git a/src/Perspex.Controls/ToolTip.cs b/src/Perspex.Controls/ToolTip.cs index 559db90ff3..aa850aa1fc 100644 --- a/src/Perspex.Controls/ToolTip.cs +++ b/src/Perspex.Controls/ToolTip.cs @@ -24,7 +24,7 @@ namespace Perspex.Controls /// /// Defines the ToolTip.Tip attached property. /// - public static readonly PerspexProperty TipProperty = + public static readonly AttachedProperty TipProperty = PerspexProperty.RegisterAttached("Tip"); /// diff --git a/src/Perspex.Controls/TopLevel.cs b/src/Perspex.Controls/TopLevel.cs index 3b4c8f2d66..589ef42399 100644 --- a/src/Perspex.Controls/TopLevel.cs +++ b/src/Perspex.Controls/TopLevel.cs @@ -29,19 +29,19 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty ClientSizeProperty = + public static readonly DirectProperty ClientSizeProperty = PerspexProperty.RegisterDirect(nameof(ClientSize), o => o.ClientSize); /// /// Defines the property. /// - public static readonly PerspexProperty IsActiveProperty = + public static readonly DirectProperty IsActiveProperty = PerspexProperty.RegisterDirect(nameof(IsActive), o => o.IsActive); /// /// Defines the property. /// - public static readonly PerspexProperty PointerOverElementProperty = + public static readonly StyledProperty PointerOverElementProperty = PerspexProperty.Register(nameof(IInputRoot.PointerOverElement)); private readonly IRenderQueueManager _renderQueueManager; diff --git a/src/Perspex.Controls/TreeView.cs b/src/Perspex.Controls/TreeView.cs index dd36db7ec0..6fe61be20a 100644 --- a/src/Perspex.Controls/TreeView.cs +++ b/src/Perspex.Controls/TreeView.cs @@ -21,7 +21,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty AutoScrollToSelectedItemProperty = + public static readonly StyledProperty AutoScrollToSelectedItemProperty = PerspexProperty.Register( nameof(AutoScrollToSelectedItem), defaultValue: true); @@ -29,7 +29,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty SelectedItemProperty = + public static readonly DirectProperty SelectedItemProperty = SelectingItemsControl.SelectedItemProperty.AddOwner( o => o.SelectedItem, (o, v) => o.SelectedItem = v); diff --git a/src/Perspex.Controls/TreeViewItem.cs b/src/Perspex.Controls/TreeViewItem.cs index e2d8107cfc..fe74ebfd93 100644 --- a/src/Perspex.Controls/TreeViewItem.cs +++ b/src/Perspex.Controls/TreeViewItem.cs @@ -19,13 +19,13 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty IsExpandedProperty = + public static readonly StyledProperty IsExpandedProperty = PerspexProperty.Register("IsExpanded"); /// /// Defines the property. /// - public static readonly PerspexProperty IsSelectedProperty = + public static readonly StyledProperty IsSelectedProperty = ListBoxItem.IsSelectedProperty.AddOwner(); private static readonly ITemplate DefaultPanel = diff --git a/src/Perspex.Controls/Window.cs b/src/Perspex.Controls/Window.cs index 7798bde1f4..d7d9745762 100644 --- a/src/Perspex.Controls/Window.cs +++ b/src/Perspex.Controls/Window.cs @@ -46,19 +46,19 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty SizeToContentProperty = + public static readonly StyledProperty SizeToContentProperty = PerspexProperty.Register(nameof(SizeToContent)); /// /// Enables of disables system window decorations (title bar, buttons, etc) /// - public static readonly PerspexProperty HasSystemDecorationsProperty = + public static readonly StyledProperty HasSystemDecorationsProperty = PerspexProperty.Register(nameof(HasSystemDecorations), true); /// /// Defines the property. /// - public static readonly PerspexProperty TitleProperty = + public static readonly StyledProperty TitleProperty = PerspexProperty.Register(nameof(Title), "Window"); private readonly NameScope _nameScope = new NameScope(); diff --git a/src/Perspex.Controls/WrapPanel.cs b/src/Perspex.Controls/WrapPanel.cs index 5a7b83cefa..62780164c8 100644 --- a/src/Perspex.Controls/WrapPanel.cs +++ b/src/Perspex.Controls/WrapPanel.cs @@ -22,7 +22,7 @@ namespace Perspex.Controls /// /// Defines the property. /// - public static readonly PerspexProperty OrientationProperty = + public static readonly StyledProperty OrientationProperty = PerspexProperty.Register(nameof(Orientation), defaultValue: Orientation.Horizontal); /// diff --git a/src/Perspex.Diagnostics/Views/ControlDetailsView.cs b/src/Perspex.Diagnostics/Views/ControlDetailsView.cs index fdbe7fd54f..51fae4df98 100644 --- a/src/Perspex.Diagnostics/Views/ControlDetailsView.cs +++ b/src/Perspex.Diagnostics/Views/ControlDetailsView.cs @@ -13,7 +13,7 @@ namespace Perspex.Diagnostics.Views { internal class ControlDetailsView : UserControl { - private static readonly PerspexProperty ViewModelProperty = + private static readonly StyledProperty ViewModelProperty = PerspexProperty.Register("ViewModel"); public ControlDetailsView() diff --git a/src/Perspex.Diagnostics/Views/GridRepeater.cs b/src/Perspex.Diagnostics/Views/GridRepeater.cs index 1189f11455..5a182cc799 100644 --- a/src/Perspex.Diagnostics/Views/GridRepeater.cs +++ b/src/Perspex.Diagnostics/Views/GridRepeater.cs @@ -10,10 +10,10 @@ namespace Perspex.Diagnostics.Views { internal static class GridRepeater { - public static readonly PerspexProperty ItemsProperty = + public static readonly AttachedProperty ItemsProperty = PerspexProperty.RegisterAttached("Items", typeof(GridRepeater)); - public static readonly PerspexProperty>> TemplateProperty = + public static readonly AttachedProperty>> TemplateProperty = PerspexProperty.RegisterAttached>>("Template", typeof(GridRepeater)); static GridRepeater() diff --git a/src/Perspex.Input/KeyBinding.cs b/src/Perspex.Input/KeyBinding.cs index 33a41e7fee..108690e6ef 100644 --- a/src/Perspex.Input/KeyBinding.cs +++ b/src/Perspex.Input/KeyBinding.cs @@ -9,7 +9,7 @@ namespace Perspex.Input { public class KeyBinding : PerspexObject { - public static readonly PerspexProperty CommandProperty = + public static readonly StyledProperty CommandProperty = PerspexProperty.Register("Command"); public ICommand Command @@ -18,7 +18,7 @@ namespace Perspex.Input set { SetValue(CommandProperty, value); } } - public static readonly PerspexProperty GestureProperty = + public static readonly StyledProperty GestureProperty = PerspexProperty.Register("Gesture"); public KeyGesture Gesture diff --git a/src/Perspex.Layout/Layoutable.cs b/src/Perspex.Layout/Layoutable.cs index c804f1a3c7..d9f6f96521 100644 --- a/src/Perspex.Layout/Layoutable.cs +++ b/src/Perspex.Layout/Layoutable.cs @@ -69,67 +69,67 @@ namespace Perspex.Layout /// /// Defines the property. /// - public static readonly PerspexProperty DesiredSizeProperty = + public static readonly DirectProperty DesiredSizeProperty = PerspexProperty.RegisterDirect(nameof(DesiredSize), o => o.DesiredSize); /// /// Defines the property. /// - public static readonly PerspexProperty WidthProperty = + public static readonly StyledProperty WidthProperty = PerspexProperty.Register(nameof(Width), double.NaN); /// /// Defines the property. /// - public static readonly PerspexProperty HeightProperty = + public static readonly StyledProperty HeightProperty = PerspexProperty.Register(nameof(Height), double.NaN); /// /// Defines the property. /// - public static readonly PerspexProperty MinWidthProperty = + public static readonly StyledProperty MinWidthProperty = PerspexProperty.Register(nameof(MinWidth)); /// /// Defines the property. /// - public static readonly PerspexProperty MaxWidthProperty = + public static readonly StyledProperty MaxWidthProperty = PerspexProperty.Register(nameof(MaxWidth), double.PositiveInfinity); /// /// Defines the property. /// - public static readonly PerspexProperty MinHeightProperty = + public static readonly StyledProperty MinHeightProperty = PerspexProperty.Register(nameof(MinHeight)); /// /// Defines the property. /// - public static readonly PerspexProperty MaxHeightProperty = + public static readonly StyledProperty MaxHeightProperty = PerspexProperty.Register(nameof(MaxHeight), double.PositiveInfinity); /// /// Defines the property. /// - public static readonly PerspexProperty MarginProperty = + public static readonly StyledProperty MarginProperty = PerspexProperty.Register(nameof(Margin)); /// /// Defines the property. /// - public static readonly PerspexProperty HorizontalAlignmentProperty = + public static readonly StyledProperty HorizontalAlignmentProperty = PerspexProperty.Register(nameof(HorizontalAlignment)); /// /// Defines the property. /// - public static readonly PerspexProperty VerticalAlignmentProperty = + public static readonly StyledProperty VerticalAlignmentProperty = PerspexProperty.Register(nameof(VerticalAlignment)); /// /// Defines the property. /// - public static readonly PerspexProperty UseLayoutRoundingProperty = + public static readonly StyledProperty UseLayoutRoundingProperty = PerspexProperty.Register(nameof(UseLayoutRounding), defaultValue: true, inherits: true); private Size? _previousMeasure; diff --git a/src/Perspex.SceneGraph/Media/Brush.cs b/src/Perspex.SceneGraph/Media/Brush.cs index 4b7673606a..6cf90502e3 100644 --- a/src/Perspex.SceneGraph/Media/Brush.cs +++ b/src/Perspex.SceneGraph/Media/Brush.cs @@ -15,7 +15,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty OpacityProperty = + public static readonly StyledProperty OpacityProperty = PerspexProperty.Register(nameof(Opacity), 1.0); /// diff --git a/src/Perspex.SceneGraph/Media/Geometry.cs b/src/Perspex.SceneGraph/Media/Geometry.cs index 993d183391..dcfcd9aefe 100644 --- a/src/Perspex.SceneGraph/Media/Geometry.cs +++ b/src/Perspex.SceneGraph/Media/Geometry.cs @@ -14,7 +14,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty TransformProperty = + public static readonly StyledProperty TransformProperty = PerspexProperty.Register("Transform"); /// diff --git a/src/Perspex.SceneGraph/Media/GradientBrush.cs b/src/Perspex.SceneGraph/Media/GradientBrush.cs index 756236523d..19ab82d792 100644 --- a/src/Perspex.SceneGraph/Media/GradientBrush.cs +++ b/src/Perspex.SceneGraph/Media/GradientBrush.cs @@ -8,10 +8,10 @@ namespace Perspex.Media { public abstract class GradientBrush : Brush { - public static readonly PerspexProperty SpreadMethodProperty = + public static readonly StyledProperty SpreadMethodProperty = PerspexProperty.Register(nameof(SpreadMethod)); - public static readonly PerspexProperty> GradientStopsProperty = + public static readonly StyledProperty> GradientStopsProperty = PerspexProperty.Register>(nameof(Opacity)); public GradientBrush() diff --git a/src/Perspex.SceneGraph/Media/ImageBush.cs b/src/Perspex.SceneGraph/Media/ImageBush.cs index 1b3fd07d28..0739b4dad3 100644 --- a/src/Perspex.SceneGraph/Media/ImageBush.cs +++ b/src/Perspex.SceneGraph/Media/ImageBush.cs @@ -13,7 +13,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty SourceProperty = + public static readonly StyledProperty SourceProperty = PerspexProperty.Register("Source"); /// diff --git a/src/Perspex.SceneGraph/Media/LinearGradientBrush.cs b/src/Perspex.SceneGraph/Media/LinearGradientBrush.cs index 67cf73ce30..cc1df6d7b2 100644 --- a/src/Perspex.SceneGraph/Media/LinearGradientBrush.cs +++ b/src/Perspex.SceneGraph/Media/LinearGradientBrush.cs @@ -11,7 +11,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty StartPointProperty = + public static readonly StyledProperty StartPointProperty = PerspexProperty.Register( nameof(StartPoint), RelativePoint.TopLeft); @@ -19,7 +19,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty EndPointProperty = + public static readonly StyledProperty EndPointProperty = PerspexProperty.Register( nameof(EndPoint), RelativePoint.BottomRight); diff --git a/src/Perspex.SceneGraph/Media/MatrixTransform.cs b/src/Perspex.SceneGraph/Media/MatrixTransform.cs index ea6e5c668a..1a25d73005 100644 --- a/src/Perspex.SceneGraph/Media/MatrixTransform.cs +++ b/src/Perspex.SceneGraph/Media/MatrixTransform.cs @@ -13,7 +13,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty MatrixProperty = + public static readonly StyledProperty MatrixProperty = PerspexProperty.Register("Matrix", Matrix.Identity); /// diff --git a/src/Perspex.SceneGraph/Media/RadialGradientBrush.cs b/src/Perspex.SceneGraph/Media/RadialGradientBrush.cs index f985ec4115..d73024b93f 100644 --- a/src/Perspex.SceneGraph/Media/RadialGradientBrush.cs +++ b/src/Perspex.SceneGraph/Media/RadialGradientBrush.cs @@ -12,7 +12,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty CenterProperty = + public static readonly StyledProperty CenterProperty = PerspexProperty.Register( nameof(Center), RelativePoint.Center); @@ -20,7 +20,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty GradientOriginProperty = + public static readonly StyledProperty GradientOriginProperty = PerspexProperty.Register( nameof(GradientOrigin), RelativePoint.Center); @@ -28,7 +28,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty RadiusProperty = + public static readonly StyledProperty RadiusProperty = PerspexProperty.Register( nameof(Radius), 0.5); diff --git a/src/Perspex.SceneGraph/Media/RotateTransform.cs b/src/Perspex.SceneGraph/Media/RotateTransform.cs index b2beb9f284..35e1ee7e83 100644 --- a/src/Perspex.SceneGraph/Media/RotateTransform.cs +++ b/src/Perspex.SceneGraph/Media/RotateTransform.cs @@ -13,7 +13,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty AngleProperty = + public static readonly StyledProperty AngleProperty = PerspexProperty.Register("Angle"); /// diff --git a/src/Perspex.SceneGraph/Media/TileBrush.cs b/src/Perspex.SceneGraph/Media/TileBrush.cs index 86cdc951d6..5f82db1e57 100644 --- a/src/Perspex.SceneGraph/Media/TileBrush.cs +++ b/src/Perspex.SceneGraph/Media/TileBrush.cs @@ -42,37 +42,37 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty AlignmentXProperty = + public static readonly StyledProperty AlignmentXProperty = PerspexProperty.Register(nameof(AlignmentX), AlignmentX.Center); /// /// Defines the property. /// - public static readonly PerspexProperty AlignmentYProperty = + public static readonly StyledProperty AlignmentYProperty = PerspexProperty.Register(nameof(AlignmentY), AlignmentY.Center); /// /// Defines the property. /// - public static readonly PerspexProperty DestinationRectProperty = + public static readonly StyledProperty DestinationRectProperty = PerspexProperty.Register(nameof(DestinationRect), RelativeRect.Fill); /// /// Defines the property. /// - public static readonly PerspexProperty SourceRectProperty = + public static readonly StyledProperty SourceRectProperty = PerspexProperty.Register(nameof(SourceRect), RelativeRect.Fill); /// /// Defines the property. /// - public static readonly PerspexProperty StretchProperty = + public static readonly StyledProperty StretchProperty = PerspexProperty.Register(nameof(Stretch), Stretch.Uniform); /// /// Defines the property. /// - public static readonly PerspexProperty TileModeProperty = + public static readonly StyledProperty TileModeProperty = PerspexProperty.Register(nameof(TileMode)); /// diff --git a/src/Perspex.SceneGraph/Media/TranslateTransform.cs b/src/Perspex.SceneGraph/Media/TranslateTransform.cs index 72f1e6010f..2a1cdfe069 100644 --- a/src/Perspex.SceneGraph/Media/TranslateTransform.cs +++ b/src/Perspex.SceneGraph/Media/TranslateTransform.cs @@ -13,13 +13,13 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty XProperty = + public static readonly StyledProperty XProperty = PerspexProperty.Register("X"); /// /// Defines the property. /// - public static readonly PerspexProperty YProperty = + public static readonly StyledProperty YProperty = PerspexProperty.Register("Y"); /// diff --git a/src/Perspex.SceneGraph/Media/VisualBrush.cs b/src/Perspex.SceneGraph/Media/VisualBrush.cs index 27477ac39e..6ba6200074 100644 --- a/src/Perspex.SceneGraph/Media/VisualBrush.cs +++ b/src/Perspex.SceneGraph/Media/VisualBrush.cs @@ -11,7 +11,7 @@ namespace Perspex.Media /// /// Defines the property. /// - public static readonly PerspexProperty VisualProperty = + public static readonly StyledProperty VisualProperty = PerspexProperty.Register("Visual"); /// diff --git a/tests/Perspex.Base.UnitTests/PerspexObjectTests_Binding.cs b/tests/Perspex.Base.UnitTests/PerspexObjectTests_Binding.cs index 3e7ee6f86d..418c4bd7bc 100644 --- a/tests/Perspex.Base.UnitTests/PerspexObjectTests_Binding.cs +++ b/tests/Perspex.Base.UnitTests/PerspexObjectTests_Binding.cs @@ -259,19 +259,19 @@ namespace Perspex.Base.UnitTests private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo", "foodefault"); - public static readonly PerspexProperty BazProperty = + public static readonly StyledProperty BazProperty = PerspexProperty.Register("Baz", "bazdefault", true); - public static readonly PerspexProperty QuxProperty = + public static readonly StyledProperty QuxProperty = PerspexProperty.Register("Qux", 5.6); } private class Class2 : Class1 { - public static readonly PerspexProperty BarProperty = + public static readonly StyledProperty BarProperty = PerspexProperty.Register("Bar", "bardefault"); } } diff --git a/tests/Perspex.Base.UnitTests/PerspexObjectTests_Direct.cs b/tests/Perspex.Base.UnitTests/PerspexObjectTests_Direct.cs index 13e36f40a8..93261fa01a 100644 --- a/tests/Perspex.Base.UnitTests/PerspexObjectTests_Direct.cs +++ b/tests/Perspex.Base.UnitTests/PerspexObjectTests_Direct.cs @@ -374,7 +374,7 @@ namespace Perspex.Base.UnitTests private class Class2 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly DirectProperty FooProperty = Class1.FooProperty.AddOwner(o => o.Foo, (o, v) => o.Foo = v); private string _foo = "initial2"; diff --git a/tests/Perspex.Base.UnitTests/PerspexObjectTests_GetObservable.cs b/tests/Perspex.Base.UnitTests/PerspexObjectTests_GetObservable.cs index 1c341649de..06664230f4 100644 --- a/tests/Perspex.Base.UnitTests/PerspexObjectTests_GetObservable.cs +++ b/tests/Perspex.Base.UnitTests/PerspexObjectTests_GetObservable.cs @@ -69,13 +69,13 @@ namespace Perspex.Base.UnitTests private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo", "foodefault"); } private class Class2 : Class1 { - public static readonly PerspexProperty BarProperty = + public static readonly StyledProperty BarProperty = PerspexProperty.Register("Bar", "bardefault"); } } diff --git a/tests/Perspex.Base.UnitTests/PerspexObjectTests_GetSubject.cs b/tests/Perspex.Base.UnitTests/PerspexObjectTests_GetSubject.cs index 2d2bf97ac6..9f2dbd3e6d 100644 --- a/tests/Perspex.Base.UnitTests/PerspexObjectTests_GetSubject.cs +++ b/tests/Perspex.Base.UnitTests/PerspexObjectTests_GetSubject.cs @@ -36,7 +36,7 @@ namespace Perspex.Base.UnitTests private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo", "foodefault"); public string Foo diff --git a/tests/Perspex.Base.UnitTests/PerspexObjectTests_Metadata.cs b/tests/Perspex.Base.UnitTests/PerspexObjectTests_Metadata.cs index 4233806b65..c3ff947a4d 100644 --- a/tests/Perspex.Base.UnitTests/PerspexObjectTests_Metadata.cs +++ b/tests/Perspex.Base.UnitTests/PerspexObjectTests_Metadata.cs @@ -49,31 +49,31 @@ namespace Perspex.Base.UnitTests private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo"); - public static readonly PerspexProperty BazProperty = + public static readonly StyledProperty BazProperty = PerspexProperty.Register("Baz"); - public static readonly PerspexProperty QuxProperty = + public static readonly StyledProperty QuxProperty = PerspexProperty.Register("Qux"); } private class Class2 : Class1 { - public static readonly PerspexProperty BarProperty = + public static readonly StyledProperty BarProperty = PerspexProperty.Register("Bar"); - public static readonly PerspexProperty FlobProperty = + public static readonly StyledProperty FlobProperty = PerspexProperty.Register("Flob"); - public static readonly PerspexProperty FredProperty = + public static readonly StyledProperty FredProperty = PerspexProperty.Register("Fred"); } private class AttachedOwner { - public static readonly PerspexProperty AttachedProperty = + public static readonly AttachedProperty AttachedProperty = PerspexProperty.RegisterAttached("Attached"); } } diff --git a/tests/Perspex.Base.UnitTests/PerspexObjectTests_SetValue.cs b/tests/Perspex.Base.UnitTests/PerspexObjectTests_SetValue.cs index 1037c5476a..e16778132c 100644 --- a/tests/Perspex.Base.UnitTests/PerspexObjectTests_SetValue.cs +++ b/tests/Perspex.Base.UnitTests/PerspexObjectTests_SetValue.cs @@ -167,19 +167,19 @@ namespace Perspex.Base.UnitTests private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo", "foodefault"); } private class Class2 : Class1 { - public static readonly PerspexProperty BarProperty = + public static readonly StyledProperty BarProperty = PerspexProperty.Register("Bar", "bardefault"); - public static readonly PerspexProperty FlobProperty = + public static readonly StyledProperty FlobProperty = PerspexProperty.Register("Flob"); - public static readonly PerspexProperty FredProperty = + public static readonly StyledProperty FredProperty = PerspexProperty.Register("Fred"); public Class1 Parent diff --git a/tests/Perspex.Base.UnitTests/PerspexPropertyRegistryTests.cs b/tests/Perspex.Base.UnitTests/PerspexPropertyRegistryTests.cs index cf5125cf5d..d4ebec056f 100644 --- a/tests/Perspex.Base.UnitTests/PerspexPropertyRegistryTests.cs +++ b/tests/Perspex.Base.UnitTests/PerspexPropertyRegistryTests.cs @@ -136,25 +136,25 @@ namespace Perspex.Base.UnitTests private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo"); - public static readonly PerspexProperty BazProperty = + public static readonly StyledProperty BazProperty = PerspexProperty.Register("Baz"); - public static readonly PerspexProperty QuxProperty = + public static readonly StyledProperty QuxProperty = PerspexProperty.Register("Qux"); } private class Class2 : Class1 { - public static readonly PerspexProperty BarProperty = + public static readonly StyledProperty BarProperty = PerspexProperty.Register("Bar"); - public static readonly PerspexProperty FlobProperty = + public static readonly StyledProperty FlobProperty = PerspexProperty.Register("Flob"); - public static readonly PerspexProperty FredProperty = + public static readonly StyledProperty FredProperty = PerspexProperty.Register("Fred"); } diff --git a/tests/Perspex.Base.UnitTests/PerspexPropertyTests.cs b/tests/Perspex.Base.UnitTests/PerspexPropertyTests.cs index 97a9ef2315..2074f2d585 100644 --- a/tests/Perspex.Base.UnitTests/PerspexPropertyTests.cs +++ b/tests/Perspex.Base.UnitTests/PerspexPropertyTests.cs @@ -224,7 +224,7 @@ namespace Perspex.Base.UnitTests private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo", "default"); } diff --git a/tests/Perspex.Base.UnitTests/StyledPropertyTests.cs b/tests/Perspex.Base.UnitTests/StyledPropertyTests.cs index fba73b2bb2..6685a08059 100644 --- a/tests/Perspex.Base.UnitTests/StyledPropertyTests.cs +++ b/tests/Perspex.Base.UnitTests/StyledPropertyTests.cs @@ -35,7 +35,7 @@ namespace Perspex.Base.UnitTests private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo", "default"); } diff --git a/tests/Perspex.Controls.UnitTests/Mixins/SelectableMixinTests.cs b/tests/Perspex.Controls.UnitTests/Mixins/SelectableMixinTests.cs index 68654a562c..a366753842 100644 --- a/tests/Perspex.Controls.UnitTests/Mixins/SelectableMixinTests.cs +++ b/tests/Perspex.Controls.UnitTests/Mixins/SelectableMixinTests.cs @@ -55,7 +55,7 @@ namespace Perspex.Controls.UnitTests.Mixins private class TestControl : Control, ISelectable { - public static readonly PerspexProperty IsSelectedProperty = + public static readonly StyledProperty IsSelectedProperty = PerspexProperty.Register(nameof(IsSelected)); static TestControl() diff --git a/tests/Perspex.LeakTests/ControlTests.cs b/tests/Perspex.LeakTests/ControlTests.cs index 24bcda978b..7b20a5cccf 100644 --- a/tests/Perspex.LeakTests/ControlTests.cs +++ b/tests/Perspex.LeakTests/ControlTests.cs @@ -299,7 +299,7 @@ namespace Perspex.LeakTests private class TestTemplatedControl : TemplatedControl { - public static readonly PerspexProperty IsCanvasVisibleProperty = + public static readonly StyledProperty IsCanvasVisibleProperty = PerspexProperty.Register("IsCanvasVisible"); public TestTemplatedControl() diff --git a/tests/Perspex.Markup.UnitTests/Data/ExpressionObserverTests_PerspexProperty.cs b/tests/Perspex.Markup.UnitTests/Data/ExpressionObserverTests_PerspexProperty.cs index 2c44baeda6..b126e122d0 100644 --- a/tests/Perspex.Markup.UnitTests/Data/ExpressionObserverTests_PerspexProperty.cs +++ b/tests/Perspex.Markup.UnitTests/Data/ExpressionObserverTests_PerspexProperty.cs @@ -43,7 +43,7 @@ namespace Perspex.Markup.UnitTests.Data private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo", defaultValue: "foo"); } } diff --git a/tests/Perspex.Markup.Xaml.UnitTests/Converters/PerspexPropertyConverterTest.cs b/tests/Perspex.Markup.Xaml.UnitTests/Converters/PerspexPropertyConverterTest.cs index 270b6d3d9b..5774367248 100644 --- a/tests/Perspex.Markup.Xaml.UnitTests/Converters/PerspexPropertyConverterTest.cs +++ b/tests/Perspex.Markup.Xaml.UnitTests/Converters/PerspexPropertyConverterTest.cs @@ -74,7 +74,7 @@ namespace Perspex.Markup.Xaml.UnitTests.Converters private class Class1 : PerspexObject, IStyleable { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo"); public IPerspexReadOnlyList Classes @@ -102,7 +102,7 @@ namespace Perspex.Markup.Xaml.UnitTests.Converters private class AttachedOwner { - public static readonly PerspexProperty AttachedProperty = + public static readonly AttachedProperty AttachedProperty = PerspexProperty.RegisterAttached("Attached"); } } diff --git a/tests/Perspex.Markup.Xaml.UnitTests/Data/BindingTests.cs b/tests/Perspex.Markup.Xaml.UnitTests/Data/BindingTests.cs index 64efaa07de..f676c5c828 100644 --- a/tests/Perspex.Markup.Xaml.UnitTests/Data/BindingTests.cs +++ b/tests/Perspex.Markup.Xaml.UnitTests/Data/BindingTests.cs @@ -279,10 +279,10 @@ namespace Perspex.Markup.Xaml.UnitTests.Data private class OldDataContextTest : Control { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo"); - public static readonly PerspexProperty BarProperty = + public static readonly StyledProperty BarProperty = PerspexProperty.Register("Bar"); public OldDataContextTest() diff --git a/tests/Perspex.Markup.Xaml.UnitTests/SamplePerspexObject.cs b/tests/Perspex.Markup.Xaml.UnitTests/SamplePerspexObject.cs index 81eab06b7c..1ac5cfed59 100644 --- a/tests/Perspex.Markup.Xaml.UnitTests/SamplePerspexObject.cs +++ b/tests/Perspex.Markup.Xaml.UnitTests/SamplePerspexObject.cs @@ -7,10 +7,10 @@ namespace Perspex.Markup.Xaml.UnitTests { internal class SamplePerspexObject : PerspexObject { - public static readonly PerspexProperty StringProperty = + public static readonly StyledProperty StringProperty = PerspexProperty.Register("StrProp", string.Empty); - public static readonly PerspexProperty IntProperty = + public static readonly StyledProperty IntProperty = PerspexProperty.Register("IntProp"); public int Int diff --git a/tests/Perspex.Styling.UnitTests/ActivatedSubjectTests.cs b/tests/Perspex.Styling.UnitTests/ActivatedSubjectTests.cs index 58b7d9fd46..0e3947c5d9 100644 --- a/tests/Perspex.Styling.UnitTests/ActivatedSubjectTests.cs +++ b/tests/Perspex.Styling.UnitTests/ActivatedSubjectTests.cs @@ -55,7 +55,7 @@ namespace Perspex.Styling.UnitTests private class Class1 : PerspexObject { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo", "foodefault"); public string Foo diff --git a/tests/Perspex.Styling.UnitTests/StyleTests.cs b/tests/Perspex.Styling.UnitTests/StyleTests.cs index 7066d2fe28..1b7455d19d 100644 --- a/tests/Perspex.Styling.UnitTests/StyleTests.cs +++ b/tests/Perspex.Styling.UnitTests/StyleTests.cs @@ -168,7 +168,7 @@ namespace Perspex.Styling.UnitTests private class Class1 : Control { - public static readonly PerspexProperty FooProperty = + public static readonly StyledProperty FooProperty = PerspexProperty.Register("Foo", "foodefault"); public string Foo