diff --git a/samples/XamlTestApplicationPcl/TestScrollable.cs b/samples/XamlTestApplicationPcl/TestScrollable.cs index 9a0bc8de73..cc5552375b 100644 --- a/samples/XamlTestApplicationPcl/TestScrollable.cs +++ b/samples/XamlTestApplicationPcl/TestScrollable.cs @@ -9,17 +9,12 @@ namespace XamlTestApplication public class TestScrollable : Control, IScrollable { private int itemCount = 100; - private Action _invalidateScroll; private Size _extent; private Vector _offset; private Size _viewport; private Size _lineSize; - public Action InvalidateScroll - { - get { return _invalidateScroll; } - set { _invalidateScroll = value; } - } + public Action InvalidateScroll { get; set; } Size IScrollable.Extent { @@ -28,10 +23,7 @@ namespace XamlTestApplication Vector IScrollable.Offset { - get - { - return _offset; - } + get { return _offset; } set { @@ -64,8 +56,8 @@ namespace XamlTestApplication protected override Size ArrangeOverride(Size finalSize) { _viewport = new Size(finalSize.Width, finalSize.Height / _lineSize.Height); - _extent = new Size(_lineSize.Width, itemCount); - InvalidateScroll(); + _extent = new Size(_lineSize.Width, itemCount + 1); + InvalidateScroll?.Invoke(); return finalSize; } diff --git a/src/Perspex.Controls/Primitives/IScrollable.cs b/src/Perspex.Controls/Primitives/IScrollable.cs index 65adadb15e..752c02685d 100644 --- a/src/Perspex.Controls/Primitives/IScrollable.cs +++ b/src/Perspex.Controls/Primitives/IScrollable.cs @@ -12,12 +12,17 @@ namespace Perspex.Controls.Primitives public interface IScrollable { /// - /// Gets or sets the invalidation method which notifies the attached - /// of a change in or . + /// Gets or sets the scroll invalidation method. /// /// + /// + /// This method notifies the attached of a change in + /// the , or properties. + /// + /// /// This property is set by the parent when the /// is placed inside it. + /// /// Action InvalidateScroll { get; set; }