Browse Source

Tidied up a bit.

pull/4/head
grokys 13 years ago
parent
commit
f39d2a3f3a
  1. 1
      Perspex.UnitTests/Perspex.UnitTests.csproj
  2. 91
      Perspex.UnitTests/Style.cs
  3. 2
      Perspex.Windows/DrawingContext.cs
  4. 8
      Perspex.Windows/Media/TextService.cs
  5. 24
      Perspex.Windows/Window.cs
  6. 12
      Perspex/Controls/Border.cs
  7. 8
      Perspex/Controls/Button.cs
  8. 8
      Perspex/Controls/ContentControl.cs
  9. 8
      Perspex/Controls/ContentPresenter.cs
  10. 20
      Perspex/Controls/Control.cs
  11. 8
      Perspex/Controls/Decorator.cs
  12. 8
      Perspex/Controls/TemplatedControl.cs
  13. 17
      Perspex/Controls/TextBlock.cs
  14. 16
      Perspex/Layout/LayoutManager.cs
  15. 14
      Perspex/Match.cs
  16. 3
      Perspex/Media/IDrawingContext.cs
  17. 8
      Perspex/Media/ITextService.cs
  18. 5
      Perspex/PerspexObject.cs
  19. 16
      Perspex/PerspexProperty.cs
  20. 18
      Perspex/Point.cs
  21. 8
      Perspex/ReadOnlyPerspexProperty.cs
  22. 8
      Perspex/Rect.cs
  23. 8
      Perspex/Selectors.cs
  24. 13
      Perspex/ServiceLocator.cs
  25. 22
      Perspex/Setter.cs
  26. 8
      Perspex/Size.cs
  27. 19
      Perspex/Style.cs
  28. 8
      Perspex/Thickness.cs
  29. 14
      Perspex/Visual.cs

1
Perspex.UnitTests/Perspex.UnitTests.csproj

@ -65,6 +65,7 @@
<Compile Include="PerspexPropertyTests.cs" /> <Compile Include="PerspexPropertyTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PerspexObjectTests.cs" /> <Compile Include="PerspexObjectTests.cs" />
<Compile Include="Style.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Perspex\Perspex.csproj"> <ProjectReference Include="..\Perspex\Perspex.csproj">

91
Perspex.UnitTests/Style.cs

@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
using Perspex.Controls;
namespace Perspex
{
public class Style
{
private bool applied;
public Style()
{
this.Setters = new List<Setter>();
}
public Func<Control, Match> Selector
{
get;
set;
}
public IEnumerable<Setter> Setters
{
get;
set;
}
public void Attach(Control control)
{
Match match = this.Selector(control);
if (match != null)
{
List<IObservable<bool>> o = new List<IObservable<bool>>();
while (match != null)
{
if (match.Observable != null)
{
o.Add(match.Observable);
}
match = match.Previous;
}
Observable.CombineLatest(o).Subscribe(x =>
{
if (x.All(y => y))
{
this.Apply(control);
}
else if (this.applied)
{
this.Unapply(control);
}
});
}
}
private void Apply(Control control)
{
if (this.Setters != null)
{
foreach (Setter setter in this.Setters)
{
setter.Apply(control);
}
}
this.applied = true;
}
private void Unapply(Control control)
{
if (this.Setters != null)
{
foreach (Setter setter in this.Setters)
{
setter.Unapply(control);
}
this.applied = false;
}
}
}
}

2
Perspex.Windows/DrawingContext.cs

@ -1,5 +1,5 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// <copyright file="DrawingContextDirect2D1.cs" company="Steven Kirk"> // <copyright file="DrawingContext.cs" company="Steven Kirk">
// Copyright 2013 MIT Licence. See licence.md for more information. // Copyright 2013 MIT Licence. See licence.md for more information.
// </copyright> // </copyright>
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------

8
Perspex.Windows/Media/TextService.cs

@ -1,4 +1,10 @@
namespace Perspex.Windows.Media // -----------------------------------------------------------------------
// <copyright file="TextService.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Windows.Media
{ {
using Perspex.Media; using Perspex.Media;
using SharpDX.DirectWrite; using SharpDX.DirectWrite;

24
Perspex.Windows/Window.cs

@ -1,4 +1,10 @@
namespace Perspex.Windows // -----------------------------------------------------------------------
// <copyright file="Window.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Windows
{ {
using System; using System;
using System.ComponentModel; using System.ComponentModel;
@ -11,7 +17,7 @@
public class Window : ContentControl, ILayoutRoot public class Window : ContentControl, ILayoutRoot
{ {
public static PerspexProperty<double> FontSizeProperty = public static readonly PerspexProperty<double> FontSizeProperty =
TextBlock.FontSizeProperty.AddOwner<Window>(); TextBlock.FontSizeProperty.AddOwner<Window>();
private UnmanagedMethods.WndProc wndProcDelegate; private UnmanagedMethods.WndProc wndProcDelegate;
@ -34,11 +40,13 @@
this.LayoutManager.LayoutNeeded.Subscribe(x => this.LayoutManager.LayoutNeeded.Subscribe(x =>
{ {
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Render, () => Dispatcher.CurrentDispatcher.BeginInvoke(
{ DispatcherPriority.Render,
this.LayoutManager.ExecuteLayoutPass(); () =>
this.renderer.Render(this); {
}); this.LayoutManager.ExecuteLayoutPass();
this.renderer.Render(this);
});
}); });
} }
@ -74,7 +82,7 @@
Border border = new Border(); Border border = new Border();
border.Background = new Perspex.Media.SolidColorBrush(0xffffffff); border.Background = new Perspex.Media.SolidColorBrush(0xffffffff);
ContentPresenter contentPresenter = new ContentPresenter(); ContentPresenter contentPresenter = new ContentPresenter();
contentPresenter.Bind(ContentPresenter.ContentProperty, this.GetObservable(ContentProperty)); contentPresenter.Bind(ContentPresenter.ContentProperty, this.GetObservable(Window.ContentProperty));
border.Content = contentPresenter; border.Content = contentPresenter;
return border; return border;
} }

12
Perspex/Controls/Border.cs

@ -1,4 +1,10 @@
namespace Perspex.Controls // -----------------------------------------------------------------------
// <copyright file="Border.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls
{ {
using System; using System;
using System.Reactive.Linq; using System.Reactive.Linq;
@ -14,10 +20,6 @@
if (background != null) if (background != null)
{ {
System.Diagnostics.Debug.WriteLine(
string.Format("{0} Draw Background={1}",
this.GetHashCode(),
background));
context.FillRectange(background, new Rect(this.Bounds.Size)); context.FillRectange(background, new Rect(this.Bounds.Size));
} }

8
Perspex/Controls/Button.cs

@ -13,12 +13,12 @@ namespace Perspex.Controls
protected override Visual DefaultTemplate() protected override Visual DefaultTemplate()
{ {
Border border = new Border(); Border border = new Border();
border.Bind(Border.BackgroundProperty, this.GetObservable(BackgroundProperty)); border.Bind(Border.BackgroundProperty, this.GetObservable(Button.BackgroundProperty));
border.Bind(Border.BorderBrushProperty, this.GetObservable(BorderBrushProperty)); border.Bind(Border.BorderBrushProperty, this.GetObservable(Button.BorderBrushProperty));
border.Bind(Border.BorderThicknessProperty, this.GetObservable(BorderThicknessProperty)); border.Bind(Border.BorderThicknessProperty, this.GetObservable(Button.BorderThicknessProperty));
border.Padding = new Thickness(3); border.Padding = new Thickness(3);
ContentPresenter contentPresenter = new ContentPresenter(); ContentPresenter contentPresenter = new ContentPresenter();
contentPresenter.Bind(ContentPresenter.ContentProperty, this.GetObservable(ContentProperty)); contentPresenter.Bind(ContentPresenter.ContentProperty, this.GetObservable(Button.ContentProperty));
border.Content = contentPresenter; border.Content = contentPresenter;
return border; return border;
} }

8
Perspex/Controls/ContentControl.cs

@ -1,4 +1,10 @@
namespace Perspex.Controls // -----------------------------------------------------------------------
// <copyright file="ContentControl.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

8
Perspex/Controls/ContentPresenter.cs

@ -1,4 +1,10 @@
namespace Perspex.Controls // -----------------------------------------------------------------------
// <copyright file="ContentPresenter.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

20
Perspex/Controls/Control.cs

@ -1,4 +1,10 @@
namespace Perspex.Controls // -----------------------------------------------------------------------
// <copyright file="Control.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -26,9 +32,6 @@
public abstract class Control : Visual, ILayoutable public abstract class Control : Visual, ILayoutable
{ {
internal static readonly PerspexProperty<Control> ParentPropertyRW =
PerspexProperty.Register<Control, Control>("Parent");
public static readonly ReadOnlyPerspexProperty<Control> ParentProperty = public static readonly ReadOnlyPerspexProperty<Control> ParentProperty =
new ReadOnlyPerspexProperty<Control>(ParentPropertyRW); new ReadOnlyPerspexProperty<Control>(ParentPropertyRW);
@ -50,6 +53,9 @@
public static readonly PerspexProperty<Thickness> MarginProperty = public static readonly PerspexProperty<Thickness> MarginProperty =
PerspexProperty.Register<Control, Thickness>("Margin"); PerspexProperty.Register<Control, Thickness>("Margin");
internal static readonly PerspexProperty<Control> ParentPropertyRW =
PerspexProperty.Register<Control, Control>("Parent");
public Control() public Control()
{ {
this.Classes = new ObservableCollection<string>(); this.Classes = new ObservableCollection<string>();
@ -174,6 +180,8 @@
private void AttachStyles(Control control) private void AttachStyles(Control control)
{ {
Contract.Requires<ArgumentNullException>(control != null);
if (control.Styles != null) if (control.Styles != null)
{ {
foreach (Style style in control.Styles) foreach (Style style in control.Styles)
@ -192,9 +200,11 @@
private void ParentChanged(Tuple<Control, Control> values) private void ParentChanged(Tuple<Control, Control> values)
{ {
Contract.Requires<ArgumentNullException>(values != null);
if (values.Item1 != null) if (values.Item1 != null)
{ {
//this.DetatchStyles(values.Item1); ////this.DetatchStyles(values.Item1);
} }
if (values.Item2 != null) if (values.Item2 != null)

8
Perspex/Controls/Decorator.cs

@ -1,4 +1,10 @@
namespace Perspex.Controls // -----------------------------------------------------------------------
// <copyright file="Decorator.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

8
Perspex/Controls/TemplatedControl.cs

@ -1,4 +1,10 @@
namespace Perspex.Controls // -----------------------------------------------------------------------
// <copyright file="TemplatedControl.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

17
Perspex/Controls/TextBlock.cs

@ -1,12 +1,15 @@
namespace Perspex.Controls // -----------------------------------------------------------------------
// <copyright file="TextBlock.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls
{ {
using Perspex.Media; using Perspex.Media;
public class TextBlock : Control public class TextBlock : Control
{ {
public static readonly PerspexProperty<Brush> BackgroundProperty =
Border.BackgroundProperty.AddOwner<TextBlock>();
public static readonly PerspexProperty<double> FontSizeProperty = public static readonly PerspexProperty<double> FontSizeProperty =
PerspexProperty.Register<TextBlock, double>( PerspexProperty.Register<TextBlock, double>(
"FontSize", "FontSize",
@ -21,12 +24,6 @@
public static readonly PerspexProperty<string> TextProperty = public static readonly PerspexProperty<string> TextProperty =
PerspexProperty.Register<Border, string>("Text"); PerspexProperty.Register<Border, string>("Text");
public Brush Background
{
get { return this.GetValue(BackgroundProperty); }
set { this.SetValue(BackgroundProperty, value); }
}
public double FontSize public double FontSize
{ {
get { return this.GetValue(FontSizeProperty); } get { return this.GetValue(FontSizeProperty); }

16
Perspex/Layout/LayoutManager.cs

@ -1,4 +1,10 @@
namespace Perspex.Layout // -----------------------------------------------------------------------
// <copyright file="LayoutManager.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Layout
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -24,13 +30,13 @@
public void ExecuteLayoutPass() public void ExecuteLayoutPass()
{ {
if (root != null) if (this.root != null)
{ {
root.Measure(root.ClientSize); this.root.Measure(this.root.ClientSize);
root.Arrange(new Rect(root.ClientSize)); this.root.Arrange(new Rect(this.root.ClientSize));
} }
root = null; this.root = null;
} }
public void InvalidateMeasure(ILayoutable item) public void InvalidateMeasure(ILayoutable item)

14
Perspex/Match.cs

@ -1,12 +1,14 @@
using System; // -----------------------------------------------------------------------
using System.Collections.Generic; // <copyright file="Match.cs" company="Steven Kirk">
using System.Linq; // Copyright 2014 MIT Licence. See licence.md for more information.
using System.Text; // </copyright>
using System.Threading.Tasks; // -----------------------------------------------------------------------
using Perspex.Controls;
namespace Perspex namespace Perspex
{ {
using System;
using Perspex.Controls;
public class Match public class Match
{ {
public Control Control public Control Control

3
Perspex/Media/IDrawingContext.cs

@ -4,9 +4,10 @@
// </copyright> // </copyright>
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
using System;
namespace Perspex.Media namespace Perspex.Media
{ {
using System;
/// <summary> /// <summary>
/// Defines the interface through which drawing occurs. /// Defines the interface through which drawing occurs.
/// </summary> /// </summary>

8
Perspex/Media/ITextService.cs

@ -1,4 +1,10 @@
namespace Perspex.Media // -----------------------------------------------------------------------
// <copyright file="ITextService.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Media
{ {
public interface ITextService public interface ITextService
{ {

5
Perspex/PerspexObject.cs

@ -159,7 +159,6 @@ namespace Perspex
/// <typeparam name="T">The type of the property.</typeparam> /// <typeparam name="T">The type of the property.</typeparam>
/// <param name="target">The target property.</param> /// <param name="target">The target property.</param>
/// <param name="source">The observable.</param> /// <param name="source">The observable.</param>
/// <returns>A disposable binding.</returns>
public void Bind<T>(PerspexProperty<T> target, IObservable<T> source) public void Bind<T>(PerspexProperty<T> target, IObservable<T> source)
{ {
Contract.Requires<NullReferenceException>(target != null); Contract.Requires<NullReferenceException>(target != null);
@ -384,6 +383,8 @@ namespace Perspex
/// </remarks> /// </remarks>
private void ParentPropertyChanged(object sender, PerspexPropertyChangedEventArgs e) private void ParentPropertyChanged(object sender, PerspexPropertyChangedEventArgs e)
{ {
Contract.Requires<ArgumentNullException>(e != null);
if (e.Property.Inherits && !this.IsSet(e.Property)) if (e.Property.Inherits && !this.IsSet(e.Property))
{ {
this.RaisePropertyChanged(e.Property, e.OldValue, e.NewValue); this.RaisePropertyChanged(e.Property, e.OldValue, e.NewValue);
@ -408,7 +409,7 @@ namespace Perspex
} }
} }
public void SetValueImpl(PerspexProperty property, object value) private void SetValueImpl(PerspexProperty property, object value)
{ {
Contract.Requires<NullReferenceException>(property != null); Contract.Requires<NullReferenceException>(property != null);

16
Perspex/PerspexProperty.cs

@ -1,4 +1,10 @@
namespace Perspex // -----------------------------------------------------------------------
// <copyright file="PerspexProperty.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -48,22 +54,22 @@
} }
/// <summary> /// <summary>
/// The name of the property. /// Gets the name of the property.
/// </summary> /// </summary>
public string Name { get; private set; } public string Name { get; private set; }
/// <summary> /// <summary>
/// The type of the property's value. /// Gets the type of the property's value.
/// </summary> /// </summary>
public Type ValueType { get; private set; } public Type ValueType { get; private set; }
/// <summary> /// <summary>
/// The type of the class that registers the property. /// Gets the type of the class that registers the property.
/// </summary> /// </summary>
public Type OwnerType { get; private set; } public Type OwnerType { get; private set; }
/// <summary> /// <summary>
/// Whether the property inherits its value. /// Gets a value indicating whether the property inherits its value.
/// </summary> /// </summary>
public bool Inherits { get; private set; } public bool Inherits { get; private set; }

18
Perspex/Point.cs

@ -1,4 +1,10 @@
namespace Perspex // -----------------------------------------------------------------------
// <copyright file="Point.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{ {
using System.Globalization; using System.Globalization;
@ -44,6 +50,11 @@
get { return this.y; } get { return this.y; }
} }
public static Point operator -(Point a, Point b)
{
return new Point(a.x - b.x, a.y - b.y);
}
/// <summary> /// <summary>
/// Returns the string representation of the point. /// Returns the string representation of the point.
/// </summary> /// </summary>
@ -52,10 +63,5 @@
{ {
return string.Format(CultureInfo.InvariantCulture, "{0}, {1}", this.x, this.y); return string.Format(CultureInfo.InvariantCulture, "{0}, {1}", this.x, this.y);
} }
public static Point operator-(Point a, Point b)
{
return new Point(a.x - b.x, a.y - b.y);
}
} }
} }

8
Perspex/ReadOnlyPerspexProperty.cs

@ -1,4 +1,10 @@
namespace Perspex // -----------------------------------------------------------------------
// <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 class ReadOnlyPerspexProperty<T>
{ {

8
Perspex/Rect.cs

@ -1,4 +1,10 @@
namespace Perspex // -----------------------------------------------------------------------
// <copyright file="Rect.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{ {
using System; using System;
using System.Globalization; using System.Globalization;

8
Perspex/Selectors.cs

@ -1,4 +1,10 @@
namespace Perspex // -----------------------------------------------------------------------
// <copyright file="Selectors.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

13
Perspex/ServiceLocator.cs

@ -1,11 +1,14 @@
using System; // -----------------------------------------------------------------------
using System.Collections.Generic; // <copyright file="ServiceLocator.cs" company="Steven Kirk">
using System.Linq; // Copyright 2014 MIT Licence. See licence.md for more information.
using System.Text; // </copyright>
using System.Threading.Tasks; // -----------------------------------------------------------------------
namespace Perspex namespace Perspex
{ {
using System;
using System.Collections.Generic;
public static class ServiceLocator public static class ServiceLocator
{ {
private static Dictionary<Type, Func<object>> services = private static Dictionary<Type, Func<object>> services =

22
Perspex/Setter.cs

@ -1,4 +1,10 @@
namespace Perspex // -----------------------------------------------------------------------
// <copyright file="Setter.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{ {
using System; using System;
using System.Diagnostics.Contracts; using System.Diagnostics.Contracts;
@ -26,13 +32,6 @@
this.oldValue = control.GetValue(this.Property); this.oldValue = control.GetValue(this.Property);
control.SetValue(this.Property, this.Value); control.SetValue(this.Property, this.Value);
System.Diagnostics.Debug.WriteLine(
string.Format("{0} Style Set {1}.{2}={3}",
control.GetHashCode(),
control.GetType().Name,
this.Property.Name,
this.Value));
} }
public void Unapply(Control control) public void Unapply(Control control)
@ -40,13 +39,6 @@
Contract.Requires<NullReferenceException>(control != null); Contract.Requires<NullReferenceException>(control != null);
control.SetValue(this.Property, this.oldValue); control.SetValue(this.Property, this.oldValue);
System.Diagnostics.Debug.WriteLine(
string.Format("{0} Style Unset {1}.{2}={3}",
control.GetHashCode(),
control.GetType().Name,
this.Property.Name,
oldValue));
} }
} }
} }

8
Perspex/Size.cs

@ -1,4 +1,10 @@
namespace Perspex // -----------------------------------------------------------------------
// <copyright file="Size.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{ {
using System; using System;
using System.Globalization; using System.Globalization;

19
Perspex/Style.cs

@ -1,14 +1,17 @@
using System; // -----------------------------------------------------------------------
using System.Collections.Generic; // <copyright file="Style.cs" company="Tricycle">
using System.Linq; // Copyright 2014 Tricycle. All rights reserved.
using System.Reactive.Disposables; // </copyright>
using System.Reactive.Linq; // -----------------------------------------------------------------------
using System.Text;
using System.Threading.Tasks;
using Perspex.Controls;
namespace Perspex namespace Perspex
{ {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Linq;
using Perspex.Controls;
public class Style public class Style
{ {
private bool applied; private bool applied;

8
Perspex/Thickness.cs

@ -1,4 +1,10 @@
namespace Perspex // -----------------------------------------------------------------------
// <copyright file="Thickness.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{ {
using System; using System;
using System.Diagnostics.Contracts; using System.Diagnostics.Contracts;

14
Perspex/Visual.cs

@ -1,4 +1,10 @@
namespace Perspex // -----------------------------------------------------------------------
// <copyright file="Visual.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -11,12 +17,12 @@
public static readonly ReadOnlyPerspexProperty<Rect> BoundsProperty = public static readonly ReadOnlyPerspexProperty<Rect> BoundsProperty =
new ReadOnlyPerspexProperty<Rect>(BoundsPropertyRW); new ReadOnlyPerspexProperty<Rect>(BoundsPropertyRW);
private static readonly PerspexProperty<Rect> BoundsPropertyRW =
PerspexProperty.Register<Visual, Rect>("Bounds");
public static readonly PerspexProperty<bool> IsMouseOverProperty = public static readonly PerspexProperty<bool> IsMouseOverProperty =
PerspexProperty.Register<Visual, bool>("IsMouseOver"); PerspexProperty.Register<Visual, bool>("IsMouseOver");
private static readonly PerspexProperty<Rect> BoundsPropertyRW =
PerspexProperty.Register<Visual, Rect>("Bounds");
private Visual visualParent; private Visual visualParent;
public Rect Bounds public Rect Bounds

Loading…
Cancel
Save