A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
1.1 KiB

// -----------------------------------------------------------------------
// <copyright file="Rectangle.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Controls.Shapes
{
using Perspex.Media;
public class Rectangle : Shape
{
private Geometry geometry;
private Size geometrySize;
public override Geometry DefiningGeometry
{
get
{
if (this.geometry == null || this.geometrySize != this.ActualSize)
{
this.geometry = new RectangleGeometry(new Rect(0, 0, this.ActualSize.Width, this.ActualSize.Height));
this.geometrySize = this.ActualSize;
}
return this.geometry;
}
}
protected override Size MeasureOverride(Size availableSize)
{
return new Size(this.StrokeThickness, this.StrokeThickness);
}
}
}