Browse Source

Handle window resize.

pull/10/head
Steven Kirk 12 years ago
parent
commit
195d4c3766
  1. 9
      Perspex.Controls/Window.cs

9
Perspex.Controls/Window.cs

@ -66,6 +66,7 @@ namespace Perspex.Controls
this.impl.Activated += this.HandleActivated;
this.impl.Closed += this.HandleClosed;
this.impl.Input += this.HandleInput;
this.impl.Resized += this.HandleResized;
Size clientSize = this.ClientSize = this.impl.ClientSize;
this.dispatcher = Dispatcher.UIThread;
@ -144,6 +145,14 @@ namespace Perspex.Controls
this.dispatcher.InvokeAsync(this.RenderVisualTree, DispatcherPriority.Render);
}
private void HandleResized(object sender, RawSizeEventArgs e)
{
this.ClientSize = e.Size;
this.renderer.Resize((int)e.Size.Width, (int)e.Size.Height);
this.LayoutManager.ExecuteLayoutPass();
this.RenderVisualTree();
}
private void LayoutPass()
{
this.LayoutManager.ExecuteLayoutPass();

Loading…
Cancel
Save