Browse Source

Removed readonly perspex properties.

They were half-baked. Will add them back in again later.
pull/4/head
Steven Kirk 12 years ago
parent
commit
111c562d3d
  1. 11
      Perspex/Controls/Control.cs
  2. 1
      Perspex/Perspex.csproj
  3. 26
      Perspex/PerspexObject.cs
  4. 18
      Perspex/ReadOnlyPerspexProperty.cs

11
Perspex/Controls/Control.cs

@ -71,8 +71,8 @@ namespace Perspex.Controls
public static readonly PerspexProperty<double> MinWidthProperty =
PerspexProperty.Register<Control, double>("MinWidth");
public static readonly ReadOnlyPerspexProperty<Control> ParentProperty =
new ReadOnlyPerspexProperty<Control>(ParentPropertyRW);
public static readonly PerspexProperty<Control> ParentProperty =
PerspexProperty.Register<Control, Control>("Parent");
public static readonly PerspexProperty<VerticalAlignment> VerticalAlignmentProperty =
PerspexProperty.Register<Control, VerticalAlignment>("VerticalAlignment");
@ -86,9 +86,6 @@ namespace Perspex.Controls
public static readonly RoutedEvent<PointerEventArgs> PointerReleasedEvent =
RoutedEvent.Register<Control, PointerEventArgs>("PointerReleased", RoutingStrategy.Bubble);
internal static readonly PerspexProperty<Control> ParentPropertyRW =
PerspexProperty.Register<Control, Control>("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

1
Perspex/Perspex.csproj

@ -115,7 +115,6 @@
<Compile Include="PerspexProperty.cs" />
<Compile Include="PerspexPropertyChangedEventArgs.cs" />
<Compile Include="Point.cs" />
<Compile Include="ReadOnlyPerspexProperty.cs" />
<Compile Include="Styling\Selector.cs" />
<Compile Include="RoutedEventArgs.cs" />
<Compile Include="Styling\Selectors.cs" />

26
Perspex/PerspexObject.cs

@ -254,19 +254,6 @@ namespace Perspex
return this.GetObservable((PerspexProperty)property).Cast<T>();
}
/// <summary>
/// Gets an observable for a <see cref="ReadOnlyPerspexProperty"/>.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="property"></param>
/// <returns></returns>
public IObservable<T> GetObservable<T>(ReadOnlyPerspexProperty<T> property)
{
Contract.Requires<NullReferenceException>(property != null);
return this.GetObservable((PerspexProperty<T>)property.Property);
}
/// <summary>
/// Gets an observable for a <see cref="PerspexProperty"/>.
/// </summary>
@ -336,19 +323,6 @@ namespace Perspex
return (T)this.GetValue((PerspexProperty)property);
}
/// <summary>
/// Gets a <see cref="ReadOnlyPerspexProperty"/> value.
/// </summary>
/// <typeparam name="T">The type of the property.</typeparam>
/// <param name="property">The property.</param>
/// <returns>The value.</returns>
public T GetValue<T>(ReadOnlyPerspexProperty<T> property)
{
Contract.Requires<NullReferenceException>(property != null);
return (T)this.GetValue(property.Property);
}
/// <summary>
/// Checks whether a <see cref="PerspexProperty"/> is set on this object.
/// </summary>

18
Perspex/ReadOnlyPerspexProperty.cs

@ -1,18 +0,0 @@
// -----------------------------------------------------------------------
// <copyright file="ReadOnlyPerspexProperty.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{
public class ReadOnlyPerspexProperty<T>
{
public ReadOnlyPerspexProperty(PerspexProperty property)
{
this.Property = property;
}
internal PerspexProperty Property { get; private set; }
}
}
Loading…
Cancel
Save