diff --git a/Perspex.Controls/DefinitionBase.cs b/Perspex.Controls/DefinitionBase.cs
index f36cab0052..aca0b55859 100644
--- a/Perspex.Controls/DefinitionBase.cs
+++ b/Perspex.Controls/DefinitionBase.cs
@@ -1,20 +1,29 @@
// -----------------------------------------------------------------------
//
-// Copyright 2013 MIT Licence. See licence.md for more information.
+// Copyright 2015 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Controls
{
+ ///
+ /// Base class for and .
+ ///
public class DefinitionBase : PerspexObject
{
+ ///
+ /// Defines the property.
+ ///
public static readonly PerspexProperty SharedSizeGroupProperty =
- PerspexProperty.Register("SharedSizeGroup", inherits: true);
+ PerspexProperty.Register(nameof(SharedSizeGroup), inherits: true);
+ ///
+ /// Gets or sets the name of the shared size group of the column or row.
+ ///
public string SharedSizeGroup
{
get { return this.GetValue(SharedSizeGroupProperty); }
set { this.SetValue(SharedSizeGroupProperty, value); }
}
}
-}
+}
\ No newline at end of file
diff --git a/Perspex.Controls/ISelectable.cs b/Perspex.Controls/ISelectable.cs
index dae37394fa..405e1161b1 100644
--- a/Perspex.Controls/ISelectable.cs
+++ b/Perspex.Controls/ISelectable.cs
@@ -1,13 +1,27 @@
// -----------------------------------------------------------------------
//
-// Copyright 2014 MIT Licence. See licence.md for more information.
+// Copyright 2015 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Controls
{
+ using Perspex.Controls.Primitives;
+
+ ///
+ /// Interface for objects that are selectable.
+ ///
+ ///
+ /// Controls such as use this interface to indicate the selected
+ /// control in a list. If changing the control's property should
+ /// update the selection in a or equivalent, then the
+ /// control should raise the .
+ ///
public interface ISelectable
{
+ ///
+ /// Gets or sets the selected state of the object.
+ ///
bool IsSelected { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/Perspex.Controls/Image.cs b/Perspex.Controls/Image.cs
index 3e3ef957b2..698d4dc206 100644
--- a/Perspex.Controls/Image.cs
+++ b/Perspex.Controls/Image.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
//
-// Copyright 2013 MIT Licence. See licence.md for more information.
+// Copyright 2015 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
@@ -10,27 +10,46 @@ namespace Perspex.Controls
using Perspex.Media;
using Perspex.Media.Imaging;
+ ///
+ /// Displays a image.
+ ///
public class Image : Control
{
+ ///
+ /// Defines the property.
+ ///
public static readonly PerspexProperty SourceProperty =
- PerspexProperty.Register("Source");
+ PerspexProperty.Register(nameof(Source));
+ ///
+ /// Defines the property.
+ ///
public static readonly PerspexProperty StretchProperty =
- PerspexProperty.Register("Stretch", Stretch.Uniform);
+ PerspexProperty.Register(nameof(Stretch), Stretch.Uniform);
+ ///
+ /// Gets or sets the bitmap image that will be displayed.
+ ///
public Bitmap Source
{
get { return this.GetValue(SourceProperty); }
set { this.SetValue(SourceProperty, value); }
}
- public Stretch Stretch
- {
+ ///
+ /// Gets or sets a value controlling how the image will be stretched.
+ ///
+ public Stretch Stretch
+ {
get { return (Stretch)this.GetValue(StretchProperty); }
set { this.SetValue(StretchProperty, value); }
}
- public override void Render(IDrawingContext drawingContext)
+ ///
+ /// Renders the control.
+ ///
+ /// The drawing context.
+ public override void Render(IDrawingContext context)
{
Bitmap source = this.Source;
@@ -46,10 +65,15 @@ namespace Perspex.Controls
Rect sourceRect = new Rect(sourceSize)
.CenterIn(new Rect(destRect.Size / scale));
- drawingContext.DrawImage(source, 1, sourceRect, destRect);
+ context.DrawImage(source, 1, sourceRect, destRect);
}
}
+ ///
+ /// Measures the control.
+ ///
+ /// The available size.
+ /// The desired size of the control.
protected override Size MeasureOverride(Size availableSize)
{
double width = 0;
@@ -77,11 +101,13 @@ namespace Perspex.Controls
return new Size(width * scale.X, height * scale.Y);
}
- protected override Size ArrangeOverride(Size finalSize)
- {
- return finalSize;
- }
-
+ ///
+ /// Calculates the scaling for the image.
+ ///
+ /// The size available to display the image.
+ /// The pxiel size of the image.
+ /// The stretch mode of the control.
+ /// A vector with the X and Y scaling factors.
private static Vector CalculateScaling(Size availableSize, Size imageSize, Stretch stretch)
{
double scaleX = 1;
@@ -106,4 +132,4 @@ namespace Perspex.Controls
return new Vector(scaleX, scaleY);
}
}
-}
+}
\ No newline at end of file
diff --git a/Perspex.Controls/Primitives/AccessText.cs b/Perspex.Controls/Primitives/AccessText.cs
index 6bcf6f6714..a6b8c60167 100644
--- a/Perspex.Controls/Primitives/AccessText.cs
+++ b/Perspex.Controls/Primitives/AccessText.cs
@@ -7,12 +7,10 @@
namespace Perspex.Controls.Primitives
{
using System;
- using Perspex.Media;
using Perspex.Input;
+ using Perspex.Media;
using Perspex.Rendering;
-
-
///
/// A text block that displays a character prefixed with an underscore as an access key.
///
diff --git a/Perspex.Controls/Primitives/HeaderedContentControl.cs b/Perspex.Controls/Primitives/HeaderedContentControl.cs
index bfd9478706..f42ea56bb4 100644
--- a/Perspex.Controls/Primitives/HeaderedContentControl.cs
+++ b/Perspex.Controls/Primitives/HeaderedContentControl.cs
@@ -6,15 +6,24 @@
namespace Perspex.Controls.Primitives
{
+ ///
+ /// A with a header.
+ ///
public class HeaderedContentControl : ContentControl, IHeadered
{
+ ///
+ /// Defines the property.
+ ///
public static readonly PerspexProperty