diff --git a/Perspex.Controls/TopLevel.cs b/Perspex.Controls/TopLevel.cs
index 8612155b71..28c4cd96fe 100644
--- a/Perspex.Controls/TopLevel.cs
+++ b/Perspex.Controls/TopLevel.cs
@@ -6,6 +6,9 @@
namespace Perspex.Controls
{
+ using System;
+ using System.Reactive.Disposables;
+ using System.Reactive.Linq;
using Perspex.Input;
using Perspex.Input.Raw;
using Perspex.Layout;
@@ -14,16 +17,13 @@ namespace Perspex.Controls
using Perspex.Styling;
using Perspex.Threading;
using Splat;
- using System;
- using System.Reactive.Disposables;
- using System.Reactive.Linq;
///
/// Base class for top-level windows.
///
///
- /// This class acts as a base for top level windows such as and
- /// . It handles scheduling layout, styling and rendering as well as
+ /// This class acts as a base for top level windows such as and
+ /// . It handles scheduling layout, styling and rendering as well as
/// tracking the window and state.
///
public abstract class TopLevel : ContentControl, ILayoutRoot, IRenderRoot, ICloseable, IFocusScope
@@ -63,7 +63,7 @@ namespace Perspex.Controls
private bool autoSizing;
///
- /// Statically initializes the class.
+ /// Initializes static members of the class.
///
static TopLevel()
{
@@ -120,7 +120,7 @@ namespace Perspex.Controls
this.PlatformImpl.Input = this.HandleInput;
this.PlatformImpl.Paint = this.HandlePaint;
this.PlatformImpl.Resized = this.HandleResized;
-
+
Size clientSize = this.ClientSize = this.PlatformImpl.ClientSize;
this.dispatcher = Dispatcher.UIThread;
@@ -222,6 +222,15 @@ namespace Perspex.Controls
this.PlatformImpl.Activate();
}
+ ///
+ /// Begins an auto-resize operation.
+ ///
+ /// A disposable used to finish the operation.
+ ///
+ /// When an auto-resize operation is in progress any resize events received will not be
+ /// cause the new size to be written to the and
+ /// properties.
+ ///
protected IDisposable BeginAutoSizing()
{
this.autoSizing = true;
@@ -284,6 +293,7 @@ namespace Perspex.Controls
///
/// Handles input from .
///
+ /// The event args.
private void HandleInput(RawInputEventArgs e)
{
this.inputManager.Process(e);
@@ -294,7 +304,7 @@ namespace Perspex.Controls
///
private void HandleLayoutNeeded()
{
- this.dispatcher.InvokeAsync(LayoutManager.ExecuteLayoutPass, DispatcherPriority.Render);
+ this.dispatcher.InvokeAsync(this.LayoutManager.ExecuteLayoutPass, DispatcherPriority.Render);
}
///
@@ -311,13 +321,15 @@ namespace Perspex.Controls
private void HandleRenderNeeded()
{
this.dispatcher.InvokeAsync(
- () => this.PlatformImpl.Invalidate(new Rect(this.ClientSize)),
+ () => this.PlatformImpl.Invalidate(new Rect(this.ClientSize)),
DispatcherPriority.Render);
}
///
/// Handles a paint request from .
///
+ /// The rectangle to paint.
+ /// An optional platform-specific handle.
private void HandlePaint(Rect rect, IPlatformHandle handle)
{
this.renderer.Render(this, handle);
@@ -327,6 +339,7 @@ namespace Perspex.Controls
///
/// Handles a resize notification from .
///
+ /// The new client size.
private void HandleResized(Size clientSize)
{
if (!this.autoSizing)