Browse Source

Change property getter to expression properties

pull/131/head
Nikita Tsukanov 11 years ago
parent
commit
21a3554260
  1. 5
      Tests/Perspex.Markup.Xaml.UnitTests/SampleModel/Repository.cs
  2. 10
      src/Gtk/Perspex.Cairo/Media/Imaging/BitmapImpl.cs
  3. 14
      src/Gtk/Perspex.Gtk/GtkPlatform.cs
  4. 5
      src/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs
  5. 5
      src/Gtk/Perspex.Gtk/Input/GtkMouseDevice.cs
  6. 5
      src/Gtk/Perspex.Gtk/WindowImpl.cs
  7. 33
      src/NGenerics/DataStructures/General/Heap.cs
  8. 8
      src/NGenerics/DataStructures/Queues/PriorityQueue.cs
  9. 24
      src/NGenerics/DataStructures/Trees/BinarySearchTreeBase.cs
  10. 56
      src/NGenerics/DataStructures/Trees/BinaryTree.cs
  11. 16
      src/NGenerics/Patterns/Visitor/KeyTrackingVisitor.cs
  12. 16
      src/NGenerics/Patterns/Visitor/OrderedVisitor.cs
  13. 16
      src/NGenerics/Patterns/Visitor/TrackingVisitor.cs
  14. 16
      src/NGenerics/Patterns/Visitor/ValueTrackingVisitor.cs
  15. 20
      src/Perspex.Base/Collections/PerspexDictionary.cs
  16. 35
      src/Perspex.Base/Collections/PerspexList.cs
  17. 10
      src/Perspex.Base/PerspexProperty.cs
  18. 10
      src/Perspex.Base/PriorityValue.cs
  19. 5
      src/Perspex.Base/Threading/Dispatcher.cs
  20. 20
      src/Perspex.Controls/Control.cs
  21. 30
      src/Perspex.Controls/GridLength.cs
  22. 5
      src/Perspex.Controls/ItemsControl.cs
  23. 10
      src/Perspex.Controls/MenuItem.cs
  24. 5
      src/Perspex.Controls/Presenters/ScrollContentPresenter.cs
  25. 10
      src/Perspex.Controls/Primitives/Popup.cs
  26. 15
      src/Perspex.Controls/Primitives/PopupRoot.cs
  27. 5
      src/Perspex.Controls/Shapes/Path.cs
  28. 20
      src/Perspex.Controls/TopLevel.cs
  29. 5
      src/Perspex.Controls/TreeView.cs
  30. 5
      src/Perspex.Controls/UserControl.cs
  31. 10
      src/Perspex.Controls/Window.cs
  32. 10
      src/Perspex.Diagnostics/ViewModels/DevToolsViewModel.cs
  33. 5
      src/Perspex.Diagnostics/ViewModels/LogicalTreeViewModel.cs
  34. 5
      src/Perspex.Diagnostics/ViewModels/VisualTreeViewModel.cs
  35. 10
      src/Perspex.Input/FocusManager.cs
  36. 5
      src/Perspex.Input/InputElement.cs
  37. 15
      src/Perspex.Input/KeyboardDevice.cs
  38. 10
      src/Perspex.Input/MouseDevice.cs
  39. 5
      src/Perspex.Interactivity/Interactive.cs
  40. 10
      src/Perspex.Layout/Layoutable.cs
  41. 40
      src/Perspex.SceneGraph/Matrix.cs
  42. 705
      src/Perspex.SceneGraph/Media/Colors.cs
  43. 5
      src/Perspex.SceneGraph/Media/EllipseGeometry.cs
  44. 10
      src/Perspex.SceneGraph/Media/Imaging/Bitmap.cs
  45. 5
      src/Perspex.SceneGraph/Media/Imaging/RenderTargetBitmap.cs
  46. 5
      src/Perspex.SceneGraph/Media/MatrixTransform.cs
  47. 5
      src/Perspex.SceneGraph/Media/RectangleGeometry.cs
  48. 5
      src/Perspex.SceneGraph/Media/RotateTransform.cs
  49. 5
      src/Perspex.SceneGraph/Media/StreamGeometry.cs
  50. 5
      src/Perspex.SceneGraph/Media/TranslateTransform.cs
  51. 10
      src/Perspex.SceneGraph/Origin.cs
  52. 10
      src/Perspex.SceneGraph/Point.cs
  53. 70
      src/Perspex.SceneGraph/Rect.cs
  54. 10
      src/Perspex.SceneGraph/Rendering/RenderManager.cs
  55. 10
      src/Perspex.SceneGraph/Size.cs
  56. 25
      src/Perspex.SceneGraph/Thickness.cs
  57. 10
      src/Perspex.SceneGraph/Vector.cs
  58. 18
      src/Perspex.SceneGraph/Visual.cs
  59. 25
      src/Perspex.Styling/Styling/Classes.cs
  60. 5
      src/Windows/Perspex.Direct2D1/Media/GeometryImpl.cs
  61. 10
      src/Windows/Perspex.Direct2D1/Media/Imaging/BitmapImpl.cs
  62. 10
      src/Windows/Perspex.Direct2D1/Media/StreamGeometryImpl.cs
  63. 5
      src/Windows/Perspex.Win32/Input/WindowsKeyboardDevice.cs
  64. 5
      src/Windows/Perspex.Win32/Input/WindowsMouseDevice.cs
  65. 17
      src/Windows/Perspex.Win32/Win32Platform.cs
  66. 5
      tests/Perspex.Controls.UnitTests/PanelTests.cs
  67. 10
      tests/Perspex.Controls.UnitTests/TestRoot.cs
  68. 5
      tests/Perspex.SceneGraph.UnitTests/TestVisual.cs
  69. 5
      tests/Perspex.Styling.UnitTests/TestControlBase.cs
  70. 5
      tests/Perspex.Styling.UnitTests/TestSubject.cs

5
Tests/Perspex.Markup.Xaml.UnitTests/SampleModel/Repository.cs

@ -12,9 +12,6 @@ namespace GitHubClient.ViewModels
_name = name;
}
public string Name
{
get { return _name; }
}
public string Name => _name;
}
}

10
src/Gtk/Perspex.Cairo/Media/Imaging/BitmapImpl.cs

@ -15,15 +15,9 @@ namespace Perspex.Cairo.Media.Imaging
Surface = surface;
}
public int PixelWidth
{
get { return Surface.Width; }
}
public int PixelWidth => Surface.Width;
public int PixelHeight
{
get { return Surface.Height; }
}
public int PixelHeight => Surface.Height;
public Cairo.ImageSurface Surface
{

14
src/Gtk/Perspex.Gtk/GtkPlatform.cs

@ -21,19 +21,9 @@ namespace Perspex.Gtk
Gtk.Application.Init();
}
public Size DoubleClickSize
{
get
{
// TODO: Is there a setting for this somewhere?
return new Size(4, 4);
}
}
public Size DoubleClickSize => new Size(4, 4);
public TimeSpan DoubleClickTime
{
get { return TimeSpan.FromMilliseconds(Gtk.Settings.Default.DoubleClickTime); }
}
public TimeSpan DoubleClickTime => TimeSpan.FromMilliseconds(Gtk.Settings.Default.DoubleClickTime);
public static void Initialize()
{

5
src/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs

@ -29,10 +29,7 @@ namespace Perspex.Gtk
{
}
public static new GtkKeyboardDevice Instance
{
get { return s_instance; }
}
public static new GtkKeyboardDevice Instance => s_instance;
public static Key ConvertKey(Gdk.Key key)
{

5
src/Gtk/Perspex.Gtk/Input/GtkMouseDevice.cs

@ -19,10 +19,7 @@ namespace Perspex.Gtk
{
}
public static new GtkMouseDevice Instance
{
get { return s_instance; }
}
public static new GtkMouseDevice Instance => s_instance;
internal void SetClientPosition(Point p)
{

5
src/Gtk/Perspex.Gtk/WindowImpl.cs

@ -57,10 +57,7 @@ namespace Perspex.Gtk
set;
}
IPlatformHandle ITopLevelImpl.Handle
{
get { return _windowHandle; }
}
IPlatformHandle ITopLevelImpl.Handle => _windowHandle;
public Action Activated { get; set; }

33
src/NGenerics/DataStructures/General/Heap.cs

@ -239,13 +239,7 @@ namespace NGenerics.DataStructures.General
/// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\General\HeapExamples.vb" region="Type" lang="vbnet" title="The following example shows how to use the Type property."/>
/// </example>
[SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")]
public HeapType Type
{
get
{
return _thisType;
}
}
public HeapType Type => _thisType;
#endregion
@ -258,14 +252,7 @@ namespace NGenerics.DataStructures.General
/// <code source="..\..\Source\Examples\ExampleLibraryCSharp\DataStructures\General\HeapExamples.cs" region="IsEmpty" lang="cs" title="The following example shows how to use the IsEmpty property."/>
/// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\General\HeapExamples.vb" region="IsEmpty" lang="vbnet" title="The following example shows how to use the IsEmpty property."/>
/// </example>
public bool IsEmpty
{
get
{
return Count == 0;
}
}
public bool IsEmpty => Count == 0;
/// <inheritdoc />
@ -307,13 +294,7 @@ namespace NGenerics.DataStructures.General
/// <code source="..\..\Source\Examples\ExampleLibraryCSharp\DataStructures\General\HeapExamples.cs" region="Count" lang="cs" title="The following example shows how to use the Count property."/>
/// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\General\HeapExamples.vb" region="Count" lang="vbnet" title="The following example shows how to use the Count property."/>
/// </example>
public int Count
{
get
{
return _data.Count - 1;
}
}
public int Count => _data.Count - 1;
/// <inheritdoc />
/// <example>
@ -407,13 +388,7 @@ namespace NGenerics.DataStructures.General
/// <code source="..\..\Source\Examples\ExampleLibraryCSharp\DataStructures\General\HeapExamples.cs" region="IsReadOnly" lang="cs" title="The following example shows how to use the IsReadOnly property."/>
/// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\General\HeapExamples.vb" region="IsReadOnly" lang="vbnet" title="The following example shows how to use the IsReadOnly property."/>
/// </example>
public bool IsReadOnly
{
get
{
return false;
}
}
public bool IsReadOnly => false;
#endregion

8
src/NGenerics/DataStructures/Queues/PriorityQueue.cs

@ -162,13 +162,7 @@ namespace NGenerics.DataStructures.Queues
/// <code source="..\..\Source\Examples\ExampleLibraryCSharp\DataStructures\Queues\PriorityQueueExamples.cs" region="IsReadOnly" lang="cs" title="The following example shows how to use the IsReadOnly property."/>
/// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\Queues\PriorityQueueExamples.vb" region="IsReadOnly" lang="vbnet" title="The following example shows how to use the IsReadOnly property."/>
/// </example>
public bool IsReadOnly
{
get
{
return false;
}
}
public bool IsReadOnly => false;
#endregion

24
src/NGenerics/DataStructures/Trees/BinarySearchTreeBase.cs

@ -85,13 +85,7 @@ namespace NGenerics.DataStructures.Trees
/// Gets the comparer.
/// </summary>
/// <value>The comparer.</value>
public IComparer<T> Comparer
{
get
{
return _comparer;
}
}
public IComparer<T> Comparer => _comparer;
#endregion
@ -379,13 +373,7 @@ namespace NGenerics.DataStructures.Trees
/// <code source="..\..\Source\Examples\ExampleLibraryCSharp\DataStructures\Trees\BinarySearchTreeBaseExamples.cs" region="IsEmpty" lang="cs" title="The following example shows how to use the IsEmpty property."/>
/// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\Trees\BinarySearchTreeBaseExamples.vb" region="IsEmpty" lang="vbnet" title="The following example shows how to use the IsEmpty property."/>
/// </example>
public bool IsEmpty
{
get
{
return Count == 0;
}
}
public bool IsEmpty => Count == 0;
/// <inheritdoc />
public bool Remove(T item)
@ -534,13 +522,7 @@ namespace NGenerics.DataStructures.Trees
/// <code source="..\..\Source\Examples\ExampleLibraryCSharp\DataStructures\Trees\BinarySearchTreeBaseExamples.cs" region="IsReadOnly" lang="cs" title="The following example shows how to use the IsReadOnly property."/>
/// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\Trees\BinarySearchTreeBaseExamples.vb" region="IsReadOnly" lang="vbnet" title="The following example shows how to use the IsReadOnly property."/>
/// </example>
public bool IsReadOnly
{
get
{
return false;
}
}
public bool IsReadOnly => false;
#endregion
}

56
src/NGenerics/DataStructures/Trees/BinaryTree.cs

@ -96,22 +96,10 @@ namespace NGenerics.DataStructures.Trees
#region ICollection<T> Members
/// <inheritdoc />
public bool IsEmpty
{
get
{
return Count == 0;
}
}
public bool IsEmpty => Count == 0;
/// <inheritdoc />
public bool IsFull
{
get
{
return (_leftSubtree != null) && (_rightSubtree != null);
}
}
public bool IsFull => (_leftSubtree != null) && (_rightSubtree != null);
/// <inheritdoc />
public bool Contains(T item)
@ -301,13 +289,7 @@ namespace NGenerics.DataStructures.Trees
}
/// <inheritdoc />
ITree<T> ITree<T>.Parent
{
get
{
return Parent;
}
}
ITree<T> ITree<T>.Parent => Parent;
#endregion
@ -442,13 +424,7 @@ namespace NGenerics.DataStructures.Trees
}
/// <inheritdoc />
public int Degree
{
get
{
return Count;
}
}
public int Degree => Count;
/// <summary>
/// Gets the child at the specified index.
@ -554,13 +530,7 @@ namespace NGenerics.DataStructures.Trees
/// <inheritdoc />
public virtual bool IsLeafNode
{
get
{
return Degree == 0;
}
}
public virtual bool IsLeafNode => Degree == 0;
/// <summary>
/// Removes the left child.
@ -670,26 +640,14 @@ namespace NGenerics.DataStructures.Trees
/// <summary>
/// Gets the <see cref="BinaryTree{T}"/> at the specified index.
/// </summary>
public BinaryTree<T> this[int index]
{
get
{
return GetChild(index);
}
}
public BinaryTree<T> this[int index] => GetChild(index);
#endregion
#region ICollection<T> Members
/// <inheritdoc />
public bool IsReadOnly
{
get
{
return false;
}
}
public bool IsReadOnly => false;
#endregion

16
src/NGenerics/Patterns/Visitor/KeyTrackingVisitor.cs

@ -44,13 +44,7 @@ namespace NGenerics.Patterns.Visitor
/// Gets the tracking list.
/// </summary>
/// <value>The tracking list.</value>
public IList<TKey> TrackingList
{
get
{
return _tracks;
}
}
public IList<TKey> TrackingList => _tracks;
#endregion
@ -64,13 +58,7 @@ namespace NGenerics.Patterns.Visitor
}
/// <inheritdoc />
public bool HasCompleted
{
get
{
return false;
}
}
public bool HasCompleted => false;
#endregion
}

16
src/NGenerics/Patterns/Visitor/OrderedVisitor.cs

@ -52,13 +52,7 @@ namespace NGenerics.Patterns.Visitor
/// <returns>
/// <c>true</c> if this visitor is done; otherwise, <c>false</c>.
/// </returns>
public bool HasCompleted
{
get
{
return _visitorToUse.HasCompleted;
}
}
public bool HasCompleted => _visitorToUse.HasCompleted;
/// <summary>
/// Visits the object in pre order.
@ -101,13 +95,7 @@ namespace NGenerics.Patterns.Visitor
/// Gets the visitor to use.
/// </summary>
/// <value>The visitor to use.</value>
public IVisitor<T> VisitorToUse
{
get
{
return _visitorToUse;
}
}
public IVisitor<T> VisitorToUse => _visitorToUse;
#endregion
}

16
src/NGenerics/Patterns/Visitor/TrackingVisitor.cs

@ -48,13 +48,7 @@ namespace NGenerics.Patterns.Visitor
}
/// <inheritdoc />
public bool HasCompleted
{
get
{
return false;
}
}
public bool HasCompleted => false;
#endregion
@ -64,13 +58,7 @@ namespace NGenerics.Patterns.Visitor
/// Gets the tracking list.
/// </summary>
/// <value>The tracking list.</value>
public IList<T> TrackingList
{
get
{
return _tracks;
}
}
public IList<T> TrackingList => _tracks;
#endregion
}

16
src/NGenerics/Patterns/Visitor/ValueTrackingVisitor.cs

@ -45,13 +45,7 @@ namespace NGenerics.Patterns.Visitor
/// Gets the tracking list.
/// </summary>
/// <value>The tracking list.</value>
public IList<TValue> TrackingList
{
get
{
return _tracks;
}
}
public IList<TValue> TrackingList => _tracks;
#endregion
@ -65,13 +59,7 @@ namespace NGenerics.Patterns.Visitor
}
/// <inheritdoc />
public bool HasCompleted
{
get
{
return false;
}
}
public bool HasCompleted => false;
#endregion
}

20
src/Perspex.Base/Collections/PerspexDictionary.cs

@ -40,28 +40,16 @@ namespace Perspex.Collections
public event PropertyChangedEventHandler PropertyChanged;
/// <inheritdoc/>
public int Count
{
get { return _inner.Count; }
}
public int Count => _inner.Count;
/// <inheritdoc/>
public bool IsReadOnly
{
get { return false; }
}
public bool IsReadOnly => false;
/// <inheritdoc/>
public ICollection<TKey> Keys
{
get { return _inner.Keys; }
}
public ICollection<TKey> Keys => _inner.Keys;
/// <inheritdoc/>
public ICollection<TValue> Values
{
get { return _inner.Values; }
}
public ICollection<TValue> Values => _inner.Values;
/// <summary>
/// Gets or sets the named resource.

35
src/Perspex.Base/Collections/PerspexList.cs

@ -63,46 +63,25 @@ namespace Perspex.Collections
/// <summary>
/// Gets the number of items in the collection.
/// </summary>
public int Count
{
get { return _inner.Count; }
}
public int Count => _inner.Count;
/// <inheritdoc/>
bool IList.IsFixedSize
{
get { return false; }
}
bool IList.IsFixedSize => false;
/// <inheritdoc/>
bool IList.IsReadOnly
{
get { return false; }
}
bool IList.IsReadOnly => false;
/// <inheritdoc/>
int ICollection.Count
{
get { return _inner.Count; }
}
int ICollection.Count => _inner.Count;
/// <inheritdoc/>
bool ICollection.IsSynchronized
{
get { return false; }
}
bool ICollection.IsSynchronized => false;
/// <inheritdoc/>
object ICollection.SyncRoot
{
get { return null; }
}
object ICollection.SyncRoot => null;
/// <inheritdoc/>
bool ICollection<T>.IsReadOnly
{
get { return false; }
}
bool ICollection<T>.IsReadOnly => false;
/// <summary>
/// Gets or sets the item at the specified index.

10
src/Perspex.Base/PerspexProperty.cs

@ -144,10 +144,7 @@ namespace Perspex
/// An observable that is fired when this property is initialized on a new
/// <see cref="PerspexObject"/> instance.
/// </value>
public IObservable<PerspexPropertyChangedEventArgs> Initialized
{
get { return _initialized; }
}
public IObservable<PerspexPropertyChangedEventArgs> Initialized => _initialized;
/// <summary>
/// Gets an observable that is fired when this property changes on any
@ -157,10 +154,7 @@ namespace Perspex
/// An observable that is fired when this property changes on any
/// <see cref="PerspexObject"/> instance.
/// </value>
public IObservable<PerspexPropertyChangedEventArgs> Changed
{
get { return _changed; }
}
public IObservable<PerspexPropertyChangedEventArgs> Changed => _changed;
/// <summary>
/// Provides access to a property's binding via the <see cref="PerspexObject"/>

10
src/Perspex.Base/PriorityValue.cs

@ -75,18 +75,12 @@ namespace Perspex
/// <remarks>
/// The old and new values may be the same, this class does not check for distinct values.
/// </remarks>
public IObservable<Tuple<object, object>> Changed
{
get { return _changed; }
}
public IObservable<Tuple<object, object>> Changed => _changed;
/// <summary>
/// Gets the current value.
/// </summary>
public object Value
{
get { return _value; }
}
public object Value => _value;
/// <summary>
/// Gets the priority of the binding that is currently active.

5
src/Perspex.Base/Threading/Dispatcher.cs

@ -31,10 +31,7 @@ namespace Perspex.Threading
/// <summary>
/// Gets the <see cref="Dispatcher"/> for the UI thread.
/// </summary>
public static Dispatcher UIThread
{
get { return s_instance; }
}
public static Dispatcher UIThread => s_instance;
/// <summary>
/// Runs the dispatcher's main loop.

20
src/Perspex.Controls/Control.cs

@ -228,10 +228,7 @@ namespace Perspex.Controls
/// <summary>
/// Gets the control's logical parent.
/// </summary>
public IControl Parent
{
get { return GetValue(ParentProperty); }
}
public IControl Parent => GetValue(ParentProperty);
/// <summary>
/// Gets or sets a user-defined object attached to the control.
@ -254,18 +251,12 @@ namespace Perspex.Controls
/// <summary>
/// Gets the control's logical parent.
/// </summary>
ILogical ILogical.LogicalParent
{
get { return Parent; }
}
ILogical ILogical.LogicalParent => Parent;
/// <summary>
/// Gets the control's logical children.
/// </summary>
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren
{
get { return LogicalChildren; }
}
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren => LogicalChildren;
/// <summary>
/// Gets the type by which the control is styled.
@ -276,10 +267,7 @@ namespace Perspex.Controls
/// derives from Button and adds extra functionality but is still styled as a regular
/// Button.
/// </remarks>
Type IStyleable.StyleKey
{
get { return GetType(); }
}
Type IStyleable.StyleKey => GetType();
/// <summary>
/// Gets the control's logical children.

30
src/Perspex.Controls/GridLength.cs

@ -71,50 +71,32 @@ namespace Perspex.Controls
/// Gets an instance of <see cref="GridLength"/> that indicates that a row or column should
/// auto-size to fit its content.
/// </summary>
public static GridLength Auto
{
get { return new GridLength(0, GridUnitType.Auto); }
}
public static GridLength Auto => new GridLength(0, GridUnitType.Auto);
/// <summary>
/// Gets the unit of the <see cref="GridLength"/>.
/// </summary>
public GridUnitType GridUnitType
{
get { return _type; }
}
public GridUnitType GridUnitType => _type;
/// <summary>
/// Gets a value that indicates whether the <see cref="GridLength"/> has a <see cref="GridUnitType"/> of Pixel.
/// </summary>
public bool IsAbsolute
{
get { return _type == GridUnitType.Pixel; }
}
public bool IsAbsolute => _type == GridUnitType.Pixel;
/// <summary>
/// Gets a value that indicates whether the <see cref="GridLength"/> has a <see cref="GridUnitType"/> of Auto.
/// </summary>
public bool IsAuto
{
get { return _type == GridUnitType.Auto; }
}
public bool IsAuto => _type == GridUnitType.Auto;
/// <summary>
/// Gets a value that indicates whether the <see cref="GridLength"/> has a <see cref="GridUnitType"/> of Star.
/// </summary>
public bool IsStar
{
get { return _type == GridUnitType.Star; }
}
public bool IsStar => _type == GridUnitType.Star;
/// <summary>
/// Gets the length.
/// </summary>
public double Value
{
get { return _value; }
}
public double Value => _value;
/// <summary>
/// Compares two GridLength structures for equality.

5
src/Perspex.Controls/ItemsControl.cs

@ -104,10 +104,7 @@ namespace Perspex.Controls
}
/// <inheritdoc/>
IPerspexList<ILogical> IReparentingHost.LogicalChildren
{
get { return LogicalChildren; }
}
IPerspexList<ILogical> IReparentingHost.LogicalChildren => LogicalChildren;
/// <summary>
/// Asks the control whether it wants to reparent the logical children of the specified

10
src/Perspex.Controls/MenuItem.cs

@ -181,18 +181,12 @@ namespace Perspex.Controls
/// <summary>
/// Gets or sets a value that indicates whether the <see cref="MenuItem"/> has a submenu.
/// </summary>
public bool HasSubMenu
{
get { return !Classes.Contains(":empty"); }
}
public bool HasSubMenu => !Classes.Contains(":empty");
/// <summary>
/// Gets a value that indicates whether the <see cref="MenuItem"/> is a top-level menu item.
/// </summary>
public bool IsTopLevel
{
get { return Parent is Menu; }
}
public bool IsTopLevel => Parent is Menu;
/// <summary>
/// Called when the <see cref="MenuItem"/> is clicked.

5
src/Perspex.Controls/Presenters/ScrollContentPresenter.cs

@ -54,10 +54,7 @@ namespace Perspex.Controls.Presenters
private set { SetValue(ViewportProperty, value); }
}
public bool CanScrollHorizontally
{
get { return GetValue(CanScrollHorizontallyProperty); }
}
public bool CanScrollHorizontally => GetValue(CanScrollHorizontallyProperty);
protected override Size MeasureOverride(Size availableSize)
{

10
src/Perspex.Controls/Primitives/Popup.cs

@ -130,10 +130,7 @@ namespace Perspex.Controls.Primitives
/// <summary>
/// Gets the root of the popup window.
/// </summary>
public PopupRoot PopupRoot
{
get { return _popupRoot; }
}
public PopupRoot PopupRoot => _popupRoot;
/// <summary>
/// Gets or sets a value indicating whether the popup should stay open when the popup is
@ -148,10 +145,7 @@ namespace Perspex.Controls.Primitives
/// <summary>
/// Gets the root of the popup window.
/// </summary>
IVisual IVisualTreeHost.Root
{
get { return _popupRoot; }
}
IVisual IVisualTreeHost.Root => _popupRoot;
/// <summary>
/// Opens the popup.

15
src/Perspex.Controls/Primitives/PopupRoot.cs

@ -50,10 +50,7 @@ namespace Perspex.Controls.Primitives
/// <summary>
/// Gets the platform-specific window implementation.
/// </summary>
public new IPopupImpl PlatformImpl
{
get { return (IPopupImpl)base.PlatformImpl; }
}
public new IPopupImpl PlatformImpl => (IPopupImpl)base.PlatformImpl;
/// <summary>
/// Gets the parent control in the event route.
@ -61,18 +58,12 @@ namespace Perspex.Controls.Primitives
/// <remarks>
/// Popup events are passed to their parent window. This facilitates this.
/// </remarks>
IInteractive IInteractive.InteractiveParent
{
get { return Parent; }
}
IInteractive IInteractive.InteractiveParent => Parent;
/// <summary>
/// Gets the control that is hosting the popup root.
/// </summary>
IVisual IHostedVisualTreeRoot.Host
{
get { return Parent; }
}
IVisual IHostedVisualTreeRoot.Host => Parent;
/// <summary>
/// Sets the position of the popup in screen coordinates.

5
src/Perspex.Controls/Shapes/Path.cs

@ -17,9 +17,6 @@ namespace Perspex.Controls.Shapes
set { SetValue(DataProperty, value); }
}
public override Geometry DefiningGeometry
{
get { return Data; }
}
public override Geometry DefiningGeometry => Data;
}
}

20
src/Perspex.Controls/TopLevel.cs

@ -216,34 +216,22 @@ namespace Perspex.Controls
/// <summary>
/// Gets the window renderer.
/// </summary>
IRenderer IRenderRoot.Renderer
{
get { return _renderer; }
}
IRenderer IRenderRoot.Renderer => _renderer;
/// <summary>
/// Gets the window render manager.
/// </summary>
IRenderManager IRenderRoot.RenderManager
{
get { return _renderManager; }
}
IRenderManager IRenderRoot.RenderManager => _renderManager;
/// <summary>
/// Gets the access key handler for the window.
/// </summary>
IAccessKeyHandler IInputRoot.AccessKeyHandler
{
get { return _accessKeyHandler; }
}
IAccessKeyHandler IInputRoot.AccessKeyHandler => _accessKeyHandler;
/// <summary>
/// Gets or sets the keyboard navigation handler for the window.
/// </summary>
IKeyboardNavigationHandler IInputRoot.KeyboardNavigationHandler
{
get { return _keyboardNavigationHandler; }
}
IKeyboardNavigationHandler IInputRoot.KeyboardNavigationHandler => _keyboardNavigationHandler;
/// <summary>
/// Gets or sets the input element that the pointer is currently over.

5
src/Perspex.Controls/TreeView.cs

@ -29,10 +29,7 @@ namespace Perspex.Controls
});
}
public new ITreeItemContainerGenerator ItemContainerGenerator
{
get { return (ITreeItemContainerGenerator)base.ItemContainerGenerator; }
}
public new ITreeItemContainerGenerator ItemContainerGenerator => (ITreeItemContainerGenerator)base.ItemContainerGenerator;
public object SelectedItem
{

5
src/Perspex.Controls/UserControl.cs

@ -8,9 +8,6 @@ namespace Perspex.Controls
{
public class UserControl : ContentControl, IStyleable
{
Type IStyleable.StyleKey
{
get { return typeof(ContentControl); }
}
Type IStyleable.StyleKey => typeof(ContentControl);
}
}

10
src/Perspex.Controls/Window.cs

@ -77,10 +77,7 @@ namespace Perspex.Controls
/// <summary>
/// Gets the platform-specific window implementation.
/// </summary>
public new IWindowImpl PlatformImpl
{
get { return (IWindowImpl)base.PlatformImpl; }
}
public new IWindowImpl PlatformImpl => (IWindowImpl)base.PlatformImpl;
/// <summary>
/// Gets or sets a value indicating how the window will size itself to fit its content.
@ -101,10 +98,7 @@ namespace Perspex.Controls
}
/// <inheritdoc/>
Type IStyleable.StyleKey
{
get { return typeof(Window); }
}
Type IStyleable.StyleKey => typeof(Window);
/// <summary>
/// Closes the window.

10
src/Perspex.Diagnostics/ViewModels/DevToolsViewModel.cs

@ -57,14 +57,8 @@ namespace Perspex.Diagnostics.ViewModels
private set { this.RaiseAndSetIfChanged(ref _visualTree, value); }
}
public IInputElement FocusedControl
{
get { return _focusedControl.Value; }
}
public IInputElement FocusedControl => _focusedControl.Value;
public IInputElement PointerOverElement
{
get { return _pointerOverElement.Value; }
}
public IInputElement PointerOverElement => _pointerOverElement.Value;
}
}

5
src/Perspex.Diagnostics/ViewModels/LogicalTreeViewModel.cs

@ -29,9 +29,6 @@ namespace Perspex.Diagnostics.ViewModels
set { this.RaiseAndSetIfChanged(ref _selected, value); }
}
public ControlDetailsViewModel Details
{
get { return _details.Value; }
}
public ControlDetailsViewModel Details => _details.Value;
}
}

5
src/Perspex.Diagnostics/ViewModels/VisualTreeViewModel.cs

@ -29,9 +29,6 @@ namespace Perspex.Diagnostics.ViewModels
set { this.RaiseAndSetIfChanged(ref _selected, value); }
}
public ControlDetailsViewModel Details
{
get { return _details.Value; }
}
public ControlDetailsViewModel Details => _details.Value;
}
}

10
src/Perspex.Input/FocusManager.cs

@ -35,18 +35,12 @@ namespace Perspex.Input
/// <summary>
/// Gets the instance of the <see cref="IFocusManager"/>.
/// </summary>
public static IFocusManager Instance
{
get { return Locator.Current.GetService<IFocusManager>(); }
}
public static IFocusManager Instance => Locator.Current.GetService<IFocusManager>();
/// <summary>
/// Gets the currently focused <see cref="IInputElement"/>.
/// </summary>
public IInputElement Current
{
get { return KeyboardDevice.Instance.FocusedElement; }
}
public IInputElement Current => KeyboardDevice.Instance.FocusedElement;
/// <summary>
/// Gets the current focus scope.

5
src/Perspex.Input/InputElement.cs

@ -317,10 +317,7 @@ namespace Perspex.Input
/// controls. The <see cref="IsEnabledCore"/> property takes into account the
/// <see cref="IsEnabled"/> value of this control and its parent controls.
/// </remarks>
bool IInputElement.IsEnabledCore
{
get { return IsEnabledCore; }
}
bool IInputElement.IsEnabledCore => IsEnabledCore;
/// <summary>
/// Gets a value indicating whether the control is effectively enabled for user interaction.

15
src/Perspex.Input/KeyboardDevice.cs

@ -26,20 +26,11 @@ namespace Perspex.Input
public event PropertyChangedEventHandler PropertyChanged;
public static IKeyboardDevice Instance
{
get { return Locator.Current.GetService<IKeyboardDevice>(); }
}
public static IKeyboardDevice Instance => Locator.Current.GetService<IKeyboardDevice>();
public IInputManager InputManager
{
get { return Locator.Current.GetService<IInputManager>(); }
}
public IInputManager InputManager => Locator.Current.GetService<IInputManager>();
public IFocusManager FocusManager
{
get { return Locator.Current.GetService<IFocusManager>(); }
}
public IFocusManager FocusManager => Locator.Current.GetService<IFocusManager>();
public IInputElement FocusedElement
{

10
src/Perspex.Input/MouseDevice.cs

@ -31,10 +31,7 @@ namespace Perspex.Input
.Subscribe(ProcessRawEvent);
}
public static IMouseDevice Instance
{
get { return Locator.Current.GetService<IMouseDevice>(); }
}
public static IMouseDevice Instance => Locator.Current.GetService<IMouseDevice>();
public IInputElement Captured
{
@ -42,10 +39,7 @@ namespace Perspex.Input
protected set;
}
public IInputManager InputManager
{
get { return Locator.Current.GetService<IInputManager>(); }
}
public IInputManager InputManager => Locator.Current.GetService<IInputManager>();
public Point Position
{

5
src/Perspex.Interactivity/Interactive.cs

@ -23,10 +23,7 @@ namespace Perspex.Interactivity
/// <summary>
/// Gets the interactive parent of the object for bubbling and tunnelling events.
/// </summary>
IInteractive IInteractive.InteractiveParent
{
get { return ((IVisual)this).VisualParent as IInteractive; }
}
IInteractive IInteractive.InteractiveParent => ((IVisual)this).VisualParent as IInteractive;
/// <summary>
/// Adds a handler for the specified routed event.

10
src/Perspex.Layout/Layoutable.cs

@ -283,18 +283,12 @@ namespace Perspex.Layout
/// <summary>
/// Gets the available size passed in the previous layout pass, if any.
/// </summary>
Size? ILayoutable.PreviousMeasure
{
get { return _previousMeasure; }
}
Size? ILayoutable.PreviousMeasure => _previousMeasure;
/// <summary>
/// Gets the layout rect passed in the previous layout pass, if any.
/// </summary>
Rect? ILayoutable.PreviousArrange
{
get { return _previousArrange; }
}
Rect? ILayoutable.PreviousArrange => _previousArrange;
/// <summary>
/// Creates the visual children of the control, if necessary

40
src/Perspex.SceneGraph/Matrix.cs

@ -46,66 +46,42 @@ namespace Perspex
/// <summary>
/// Returns the multiplicative identity matrix.
/// </summary>
public static Matrix Identity
{
get { return new Matrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0); }
}
public static Matrix Identity => new Matrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
/// <summary>
/// Returns whether the matrix is the identity matrix.
/// </summary>
public bool IsIdentity
{
get { return Equals(Identity); }
}
public bool IsIdentity => Equals(Identity);
/// <summary>
/// The first element of the first row
/// </summary>
public double M11
{
get { return _m11; }
}
public double M11 => _m11;
/// <summary>
/// The second element of the first row
/// </summary>
public double M12
{
get { return _m12; }
}
public double M12 => _m12;
/// <summary>
/// The first element of the second row
/// </summary>
public double M21
{
get { return _m21; }
}
public double M21 => _m21;
/// <summary>
/// The second element of the second row
/// </summary>
public double M22
{
get { return _m22; }
}
public double M22 => _m22;
/// <summary>
/// The first element of the third row
/// </summary>
public double M31
{
get { return _m31; }
}
public double M31 => _m31;
/// <summary>
/// The second element of the third row
/// </summary>
public double M32
{
get { return _m32; }
}
public double M32 => _m32;
/// <summary>
/// Multiplies two matrices together and returns the resulting matrix.

705
src/Perspex.SceneGraph/Media/Colors.cs

File diff suppressed because it is too large

5
src/Perspex.SceneGraph/Media/EllipseGeometry.cs

@ -51,10 +51,7 @@ namespace Perspex.Media
}
/// <inheritdoc/>
public override Rect Bounds
{
get { return PlatformImpl.Bounds; }
}
public override Rect Bounds => PlatformImpl.Bounds;
/// <inheritdoc/>
public override Geometry Clone()

10
src/Perspex.SceneGraph/Media/Imaging/Bitmap.cs

@ -44,18 +44,12 @@ namespace Perspex.Media.Imaging
/// <summary>
/// Gets the width of the bitmap, in pixels.
/// </summary>
public int PixelWidth
{
get { return PlatformImpl.PixelWidth; }
}
public int PixelWidth => PlatformImpl.PixelWidth;
/// <summary>
/// Gets the height of the bitmap, in pixels.
/// </summary>
public int PixelHeight
{
get { return PlatformImpl.PixelHeight; }
}
public int PixelHeight => PlatformImpl.PixelHeight;
/// <summary>
/// Gets the platform-specific bitmap implementation.

5
src/Perspex.SceneGraph/Media/Imaging/RenderTargetBitmap.cs

@ -25,10 +25,7 @@ namespace Perspex.Media.Imaging
/// <summary>
/// Gets the platform-specific bitmap implementation.
/// </summary>
public new IRenderTargetBitmapImpl PlatformImpl
{
get { return (IRenderTargetBitmapImpl)base.PlatformImpl; }
}
public new IRenderTargetBitmapImpl PlatformImpl => (IRenderTargetBitmapImpl)base.PlatformImpl;
/// <summary>
/// Renders an <see cref="IVisual"/> into the bitmap.

5
src/Perspex.SceneGraph/Media/MatrixTransform.cs

@ -46,9 +46,6 @@ namespace Perspex.Media
/// <summary>
/// Gets the matrix.
/// </summary>
public override Matrix Value
{
get { return Matrix; }
}
public override Matrix Value => Matrix;
}
}

5
src/Perspex.SceneGraph/Media/RectangleGeometry.cs

@ -33,10 +33,7 @@ namespace Perspex.Media
}
/// <inheritdoc/>
public override Rect Bounds
{
get { return PlatformImpl.Bounds; }
}
public override Rect Bounds => PlatformImpl.Bounds;
/// <inheritdoc/>
public override Geometry Clone()

5
src/Perspex.SceneGraph/Media/RotateTransform.cs

@ -46,9 +46,6 @@ namespace Perspex.Media
/// <summary>
/// Gets the tranform's <see cref="Matrix"/>.
/// </summary>
public override Matrix Value
{
get { return Matrix.CreateRotation(Matrix.ToRadians(Angle)); }
}
public override Matrix Value => Matrix.CreateRotation(Matrix.ToRadians(Angle));
}
}

5
src/Perspex.SceneGraph/Media/StreamGeometry.cs

@ -30,10 +30,7 @@ namespace Perspex.Media
}
/// <inheritdoc/>
public override Rect Bounds
{
get { return PlatformImpl.Bounds; }
}
public override Rect Bounds => PlatformImpl.Bounds;
/// <summary>
/// Creates a <see cref="StreamGeometry"/> from a string.

5
src/Perspex.SceneGraph/Media/TranslateTransform.cs

@ -64,9 +64,6 @@ namespace Perspex.Media
/// <summary>
/// Gets the tranform's <see cref="Matrix"/>.
/// </summary>
public override Matrix Value
{
get { return Matrix.CreateTranslation(X, Y); }
}
public override Matrix Value => Matrix.CreateTranslation(X, Y);
}
}

10
src/Perspex.SceneGraph/Origin.cs

@ -58,18 +58,12 @@ namespace Perspex
/// <summary>
/// Gets the origin point.
/// </summary>
public Point Point
{
get { return _point; }
}
public Point Point => _point;
/// <summary>
/// Gets the origin unit.
/// </summary>
public OriginUnit Unit
{
get { return _unit; }
}
public OriginUnit Unit => _unit;
/// <summary>
/// Converts an <see cref="Origin"/> into pixels.

10
src/Perspex.SceneGraph/Point.cs

@ -34,18 +34,12 @@ namespace Perspex
/// <summary>
/// Gets the X position.
/// </summary>
public double X
{
get { return _x; }
}
public double X => _x;
/// <summary>
/// Gets the Y position.
/// </summary>
public double Y
{
get { return _y; }
}
public double Y => _y;
/// <summary>
/// Converts the <see cref="Point"/> to a <see cref="Vector"/>.

70
src/Perspex.SceneGraph/Rect.cs

@ -87,114 +87,72 @@ namespace Perspex
/// <summary>
/// Gets the X position.
/// </summary>
public double X
{
get { return _x; }
}
public double X => _x;
/// <summary>
/// Gets the Y position.
/// </summary>
public double Y
{
get { return _y; }
}
public double Y => _y;
/// <summary>
/// Gets the width.
/// </summary>
public double Width
{
get { return _width; }
}
public double Width => _width;
/// <summary>
/// Gets the height.
/// </summary>
public double Height
{
get { return _height; }
}
public double Height => _height;
/// <summary>
/// Gets the position of the rectangle.
/// </summary>
public Point Position
{
get { return new Point(_x, _y); }
}
public Point Position => new Point(_x, _y);
/// <summary>
/// Gets the size of the rectangle.
/// </summary>
public Size Size
{
get { return new Size(_width, _height); }
}
public Size Size => new Size(_width, _height);
/// <summary>
/// Gets the right position of the rectangle.
/// </summary>
public double Right
{
get { return _x + _width; }
}
public double Right => _x + _width;
/// <summary>
/// Gets the bottom position of the rectangle.
/// </summary>
public double Bottom
{
get { return _y + _height; }
}
public double Bottom => _y + _height;
/// <summary>
/// Gets the top left point of the rectangle.
/// </summary>
public Point TopLeft
{
get { return new Point(_x, _y); }
}
public Point TopLeft => new Point(_x, _y);
/// <summary>
/// Gets the top right point of the rectangle.
/// </summary>
public Point TopRight
{
get { return new Point(Right, _y); }
}
public Point TopRight => new Point(Right, _y);
/// <summary>
/// Gets the bottom left point of the rectangle.
/// </summary>
public Point BottomLeft
{
get { return new Point(_x, Bottom); }
}
public Point BottomLeft => new Point(_x, Bottom);
/// <summary>
/// Gets the bottom right point of the rectangle.
/// </summary>
public Point BottomRight
{
get { return new Point(Right, Bottom); }
}
public Point BottomRight => new Point(Right, Bottom);
/// <summary>
/// Gets the center point of the rectangle.
/// </summary>
public Point Center
{
get { return new Point(_x + (_width / 2), _y + (_height / 2)); }
}
public Point Center => new Point(_x + (_width / 2), _y + (_height / 2));
/// <summary>
/// Gets a value that indicates whether the rectangle is empty.
/// </summary>
public bool IsEmpty
{
get { return _width == 0 && _height == 0; }
}
public bool IsEmpty => _width == 0 && _height == 0;
/// <summary>
/// Checks for equality between two <see cref="Rect"/>s.

10
src/Perspex.SceneGraph/Rendering/RenderManager.cs

@ -19,18 +19,12 @@ namespace Perspex.Rendering
/// <summary>
/// Gets an observable that is fired whenever a render is required.
/// </summary>
public IObservable<Unit> RenderNeeded
{
get { return _renderNeeded; }
}
public IObservable<Unit> RenderNeeded => _renderNeeded;
/// <summary>
/// Gets a valuue indicating whether a render is queued.
/// </summary>
public bool RenderQueued
{
get { return _renderQueued; }
}
public bool RenderQueued => _renderQueued;
/// <summary>
/// Invalidates the render for the specified visual and raises <see cref="RenderNeeded"/>.

10
src/Perspex.SceneGraph/Size.cs

@ -40,18 +40,12 @@ namespace Perspex
/// <summary>
/// Gets the width.
/// </summary>
public double Width
{
get { return _width; }
}
public double Width => _width;
/// <summary>
/// Gets the height.
/// </summary>
public double Height
{
get { return _height; }
}
public double Height => _height;
/// <summary>
/// Checks for equality between two <see cref="Size"/>s.

25
src/Perspex.SceneGraph/Thickness.cs

@ -79,42 +79,27 @@ namespace Perspex
/// <summary>
/// Gets the thickness on the left.
/// </summary>
public double Left
{
get { return _left; }
}
public double Left => _left;
/// <summary>
/// Gets the thickness on the top.
/// </summary>
public double Top
{
get { return _top; }
}
public double Top => _top;
/// <summary>
/// Gets the thickness on the right.
/// </summary>
public double Right
{
get { return _right; }
}
public double Right => _right;
/// <summary>
/// Gets the thickness on the bottom.
/// </summary>
public double Bottom
{
get { return _bottom; }
}
public double Bottom => _bottom;
/// <summary>
/// Gets a value indicating whether all sides are set to 0.
/// </summary>
public bool IsEmpty
{
get { return Left == 0 && Top == 0 && Right == 0 && Bottom == 0; }
}
public bool IsEmpty => Left == 0 && Top == 0 && Right == 0 && Bottom == 0;
/// <summary>
/// Compares two Thicknesses.

10
src/Perspex.SceneGraph/Vector.cs

@ -35,18 +35,12 @@ namespace Perspex
/// <summary>
/// Gets the X vector.
/// </summary>
public double X
{
get { return _x; }
}
public double X => _x;
/// <summary>
/// Gets the Y vector.
/// </summary>
public double Y
{
get { return _y; }
}
public double Y => _y;
/// <summary>
/// Converts the <see cref="Vector"/> to a <see cref="Point"/>.

18
src/Perspex.SceneGraph/Visual.cs

@ -190,29 +190,17 @@ namespace Perspex
/// <summary>
/// Gets a value indicating whether this scene graph node is attached to a visual root.
/// </summary>
bool IVisual.IsAttachedToVisualTree
{
get { return _isAttachedToVisualTree; }
}
bool IVisual.IsAttachedToVisualTree => _isAttachedToVisualTree;
/// <summary>
/// Gets the scene graph node's child nodes.
/// </summary>
IPerspexReadOnlyList<IVisual> IVisual.VisualChildren
{
get { return _visualChildren; }
}
IPerspexReadOnlyList<IVisual> IVisual.VisualChildren => _visualChildren;
/// <summary>
/// Gets the scene graph node's parent node.
/// </summary>
IVisual IVisual.VisualParent
{
get
{
return _visualParent;
}
}
IVisual IVisual.VisualParent => _visualParent;
/// <summary>
/// Invalidates the visual and queues a repaint.

25
src/Perspex.Styling/Styling/Classes.cs

@ -41,30 +41,15 @@ namespace Perspex.Styling
public event NotifyCollectionChangedEventHandler CollectionChanged;
public int Count
{
get { return _inner.Count; }
}
public int Count => _inner.Count;
public bool IsReadOnly
{
get { return false; }
}
public bool IsReadOnly => false;
public IObservable<NotifyCollectionChangedEventArgs> BeforeChanged
{
get { return _beforeChanged; }
}
public IObservable<NotifyCollectionChangedEventArgs> BeforeChanged => _beforeChanged;
public IObservable<NotifyCollectionChangedEventArgs> Changed
{
get { return _changed; }
}
public IObservable<NotifyCollectionChangedEventArgs> Changed => _changed;
public IObservable<NotifyCollectionChangedEventArgs> AfterChanged
{
get { return _afterChanged; }
}
public IObservable<NotifyCollectionChangedEventArgs> AfterChanged => _afterChanged;
public void Add(string item)
{

5
src/Windows/Perspex.Direct2D1/Media/GeometryImpl.cs

@ -33,10 +33,7 @@ namespace Perspex.Direct2D1.Media
/// <summary>
/// Gets the Direct2D <see cref="Geometry"/>.
/// </summary>
public Geometry Geometry
{
get { return _transformed ?? DefiningGeometry; }
}
public Geometry Geometry => _transformed ?? DefiningGeometry;
/// <summary>
/// Gets or sets the transform for the geometry.

10
src/Windows/Perspex.Direct2D1/Media/Imaging/BitmapImpl.cs

@ -52,18 +52,12 @@ namespace Perspex.Direct2D1.Media
/// <summary>
/// Gets the width of the bitmap, in pixels.
/// </summary>
public int PixelWidth
{
get { return WicImpl.Size.Height; }
}
public int PixelWidth => WicImpl.Size.Height;
/// <summary>
/// Gets the height of the bitmap, in pixels.
/// </summary>
public int PixelHeight
{
get { return WicImpl.Size.Width; }
}
public int PixelHeight => WicImpl.Size.Width;
/// <summary>
/// Gets the WIC implementation of the bitmap.

10
src/Windows/Perspex.Direct2D1/Media/StreamGeometryImpl.cs

@ -35,16 +35,10 @@ namespace Perspex.Direct2D1.Media
}
/// <inheritdoc/>
public override Rect Bounds
{
get { return _path.GetBounds().ToPerspex(); }
}
public override Rect Bounds => _path.GetBounds().ToPerspex();
/// <inheritdoc/>
public override D2DGeometry DefiningGeometry
{
get { return _path; }
}
public override D2DGeometry DefiningGeometry => _path;
/// <summary>
/// Clones the geometry.

5
src/Windows/Perspex.Win32/Input/WindowsKeyboardDevice.cs

@ -14,10 +14,7 @@ namespace Perspex.Win32.Input
private byte[] _keyStates = new byte[256];
public static new WindowsKeyboardDevice Instance
{
get { return s_instance; }
}
public static new WindowsKeyboardDevice Instance => s_instance;
public ModifierKeys Modifiers
{

5
src/Windows/Perspex.Win32/Input/WindowsMouseDevice.cs

@ -12,10 +12,7 @@ namespace Perspex.Win32.Input
{
private static WindowsMouseDevice s_instance = new WindowsMouseDevice();
public static new WindowsMouseDevice Instance
{
get { return s_instance; }
}
public static new WindowsMouseDevice Instance => s_instance;
public WindowImpl CurrentWindow
{

17
src/Windows/Perspex.Win32/Win32Platform.cs

@ -31,20 +31,11 @@ namespace Perspex.Win32
CreateMessageWindow();
}
public Size DoubleClickSize
{
get
{
return new Size(
UnmanagedMethods.GetSystemMetrics(UnmanagedMethods.SystemMetric.SM_CXDOUBLECLK),
UnmanagedMethods.GetSystemMetrics(UnmanagedMethods.SystemMetric.SM_CYDOUBLECLK));
}
}
public Size DoubleClickSize => new Size(
UnmanagedMethods.GetSystemMetrics(UnmanagedMethods.SystemMetric.SM_CXDOUBLECLK),
UnmanagedMethods.GetSystemMetrics(UnmanagedMethods.SystemMetric.SM_CYDOUBLECLK));
public TimeSpan DoubleClickTime
{
get { return TimeSpan.FromMilliseconds(UnmanagedMethods.GetDoubleClickTime()); }
}
public TimeSpan DoubleClickTime => TimeSpan.FromMilliseconds(UnmanagedMethods.GetDoubleClickTime());
private static void InitializeInternal()
{

5
tests/Perspex.Controls.UnitTests/PanelTests.cs

@ -137,10 +137,7 @@ namespace Perspex.Controls.UnitTests
private class TestReparent : Panel
{
public new IPerspexList<ILogical> LogicalChildren
{
get { return base.LogicalChildren; }
}
public new IPerspexList<ILogical> LogicalChildren => base.LogicalChildren;
}
}
}

10
tests/Perspex.Controls.UnitTests/TestRoot.cs

@ -11,15 +11,9 @@ namespace Perspex.Controls.UnitTests
{
internal class TestRoot : Decorator, ILayoutRoot, IRenderRoot
{
public Size ClientSize
{
get { return new Size(100, 100); }
}
public Size ClientSize => new Size(100, 100);
public ILayoutManager LayoutManager
{
get { return new Mock<ILayoutManager>().Object; }
}
public ILayoutManager LayoutManager => new Mock<ILayoutManager>().Object;
public IRenderer Renderer
{

5
tests/Perspex.SceneGraph.UnitTests/TestVisual.cs

@ -24,10 +24,7 @@ namespace Perspex.SceneGraph.UnitTests
public event EventHandler<ParamEventArgs<IRenderRoot>> DetachedFromVisualTreeCalled;
public new PerspexObject InheritanceParent
{
get { return base.InheritanceParent; }
}
public new PerspexObject InheritanceParent => base.InheritanceParent;
public void AddChild(Visual v)
{

5
tests/Perspex.Styling.UnitTests/TestControlBase.cs

@ -17,10 +17,7 @@ namespace Perspex.Styling.UnitTests
public virtual Classes Classes { get; set; }
public Type StyleKey
{
get { return GetType(); }
}
public Type StyleKey => GetType();
public TestObservable SubscribeCheckObservable { get; private set; }

5
tests/Perspex.Styling.UnitTests/TestSubject.cs

@ -18,10 +18,7 @@ namespace Perspex.Styling.UnitTests
_initial = initial;
}
public int SubscriberCount
{
get { return _subscribers.Count; }
}
public int SubscriberCount => _subscribers.Count;
public void OnCompleted()
{

Loading…
Cancel
Save