diff --git a/Perspex.Controls/Primitives/ScrollBar.cs b/Perspex.Controls/Primitives/ScrollBar.cs
index 3936f3d535..34d240f101 100644
--- a/Perspex.Controls/Primitives/ScrollBar.cs
+++ b/Perspex.Controls/Primitives/ScrollBar.cs
@@ -11,23 +11,41 @@ namespace Perspex.Controls.Primitives
using System.Reactive.Linq;
using Perspex.Controls.Templates;
+ ///
+ /// A scrollbar control.
+ ///
public class ScrollBar : RangeBase
{
+ ///
+ /// Defines the property.
+ ///
public static readonly PerspexProperty ViewportSizeProperty =
- PerspexProperty.Register("ViewportSize", defaultValue: double.NaN);
+ PerspexProperty.Register(nameof(ViewportSize), defaultValue: double.NaN);
+ ///
+ /// Defines the property.
+ ///
public static readonly PerspexProperty VisibilityProperty =
- PerspexProperty.Register("Visibility");
+ PerspexProperty.Register(nameof(Visibility));
+ ///
+ /// Defines the property.
+ ///
public static readonly PerspexProperty OrientationProperty =
- PerspexProperty.Register("Orientation");
+ PerspexProperty.Register(nameof(Orientation));
+ ///
+ /// Initializes static members of the class.
+ ///
static ScrollBar()
{
Control.PseudoClass(OrientationProperty, x => x == Orientation.Horizontal, ":horizontal");
Control.PseudoClass(OrientationProperty, x => x == Orientation.Vertical, ":vertical");
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
public ScrollBar()
{
var isVisible = Observable.Merge(
@@ -39,41 +57,59 @@ namespace Perspex.Controls.Primitives
this.Bind(ScrollBar.IsVisibleProperty, isVisible, BindingPriority.Style);
}
+ ///
+ /// Gets or sets the amount of the scrollable content that is currently visible.
+ ///
public double ViewportSize
{
get { return this.GetValue(ViewportSizeProperty); }
set { this.SetValue(ViewportSizeProperty, value); }
}
+ ///
+ /// Gets or sets a value that indicates whether the scrollbar should hide itself when it
+ /// is not needed.
+ ///
public ScrollBarVisibility Visibility
{
get { return this.GetValue(VisibilityProperty); }
set { this.SetValue(VisibilityProperty, value); }
}
+ ///
+ /// Gets or sets the orientation of the scrollbar.
+ ///
public Orientation Orientation
{
get { return this.GetValue(OrientationProperty); }
set { this.SetValue(OrientationProperty, value); }
}
+ ///
protected override Size MeasureOverride(Size availableSize)
{
return base.MeasureOverride(availableSize);
}
+ ///
protected override void OnTemplateApplied()
{
base.OnTemplateApplied();
- // Binding between this.Value and track.Value must be done explicitly like this rather
+ // Binding between this.Value and track.Value must be done explicitly like this rather
// than using standard bindings as it shouldn't be able to to be overridden by binding
// e.g. ScrollBar.Value.
+ // TODO: This is probably no longer true. Test and use a standard 2 way binding if
+ // possible.
var track = this.GetTemplateChild