From 111c562d3d606dd4231de8fee16240a07ac00fda Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 4 Apr 2014 00:15:47 +0200 Subject: [PATCH] Removed readonly perspex properties. They were half-baked. Will add them back in again later. --- Perspex/Controls/Control.cs | 11 ++++------- Perspex/Perspex.csproj | 1 - Perspex/PerspexObject.cs | 26 -------------------------- Perspex/ReadOnlyPerspexProperty.cs | 18 ------------------ 4 files changed, 4 insertions(+), 52 deletions(-) delete mode 100644 Perspex/ReadOnlyPerspexProperty.cs diff --git a/Perspex/Controls/Control.cs b/Perspex/Controls/Control.cs index 5d35cd6aa6..b599168387 100644 --- a/Perspex/Controls/Control.cs +++ b/Perspex/Controls/Control.cs @@ -71,8 +71,8 @@ namespace Perspex.Controls public static readonly PerspexProperty MinWidthProperty = PerspexProperty.Register("MinWidth"); - public static readonly ReadOnlyPerspexProperty ParentProperty = - new ReadOnlyPerspexProperty(ParentPropertyRW); + public static readonly PerspexProperty ParentProperty = + PerspexProperty.Register("Parent"); public static readonly PerspexProperty VerticalAlignmentProperty = PerspexProperty.Register("VerticalAlignment"); @@ -86,9 +86,6 @@ namespace Perspex.Controls public static readonly RoutedEvent PointerReleasedEvent = RoutedEvent.Register("PointerReleased", RoutingStrategy.Bubble); - internal static readonly PerspexProperty ParentPropertyRW = - PerspexProperty.Register("Parent"); - private Classes classes; private string id; @@ -264,8 +261,8 @@ namespace Perspex.Controls public Control Parent { - get { return this.GetValue(ParentPropertyRW); } - protected set { this.SetValue(ParentPropertyRW, value); } + get { return this.GetValue(ParentProperty); } + protected set { this.SetValue(ParentProperty, value); } } public Styles Styles diff --git a/Perspex/Perspex.csproj b/Perspex/Perspex.csproj index 8201a3419e..75228446c7 100644 --- a/Perspex/Perspex.csproj +++ b/Perspex/Perspex.csproj @@ -115,7 +115,6 @@ - diff --git a/Perspex/PerspexObject.cs b/Perspex/PerspexObject.cs index bdb4b01d9a..3806def60a 100644 --- a/Perspex/PerspexObject.cs +++ b/Perspex/PerspexObject.cs @@ -254,19 +254,6 @@ namespace Perspex return this.GetObservable((PerspexProperty)property).Cast(); } - /// - /// Gets an observable for a . - /// - /// - /// - /// - public IObservable GetObservable(ReadOnlyPerspexProperty property) - { - Contract.Requires(property != null); - - return this.GetObservable((PerspexProperty)property.Property); - } - /// /// Gets an observable for a . /// @@ -336,19 +323,6 @@ namespace Perspex return (T)this.GetValue((PerspexProperty)property); } - /// - /// Gets a value. - /// - /// The type of the property. - /// The property. - /// The value. - public T GetValue(ReadOnlyPerspexProperty property) - { - Contract.Requires(property != null); - - return (T)this.GetValue(property.Property); - } - /// /// Checks whether a is set on this object. /// diff --git a/Perspex/ReadOnlyPerspexProperty.cs b/Perspex/ReadOnlyPerspexProperty.cs deleted file mode 100644 index d08eb254ad..0000000000 --- a/Perspex/ReadOnlyPerspexProperty.cs +++ /dev/null @@ -1,18 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright 2014 MIT Licence. See licence.md for more information. -// -// ----------------------------------------------------------------------- - -namespace Perspex -{ - public class ReadOnlyPerspexProperty - { - public ReadOnlyPerspexProperty(PerspexProperty property) - { - this.Property = property; - } - - internal PerspexProperty Property { get; private set; } - } -}