Browse Source

Merge branch 'master' of https://github.com/Perspex/Perspex

pull/484/head
Steven Kirk 11 years ago
parent
commit
ce62001dde
  1. 13
      src/Perspex.Controls/Window.cs

13
src/Perspex.Controls/Window.cs

@ -10,6 +10,7 @@ using Perspex.Layout;
using Perspex.Media;
using Perspex.Platform;
using Perspex.Styling;
using System.Collections.Generic;
namespace Perspex.Controls
{
@ -44,6 +45,13 @@ namespace Perspex.Controls
/// </summary>
public class Window : TopLevel, IStyleable, IFocusScope, ILayoutRoot, INameScope
{
private static IList<Window> s_windows = new List<Window>();
/// <summary>
/// Retrieves an enumeration of all Windows in the currently running application.
/// </summary>
public static IList<Window> OpenWindows => s_windows;
/// <summary>
/// Defines the <see cref="SizeToContent"/> property.
/// </summary>
@ -153,6 +161,7 @@ namespace Perspex.Controls
/// </summary>
public void Close()
{
s_windows.Remove(this);
PlatformImpl.Dispose();
}
@ -193,6 +202,8 @@ namespace Perspex.Controls
/// </summary>
public void Show()
{
s_windows.Add(this);
LayoutManager.Instance.ExecuteInitialLayoutPass(this);
using (BeginAutoSizing())
@ -223,6 +234,8 @@ namespace Perspex.Controls
/// </returns>
public Task<TResult> ShowDialog<TResult>()
{
s_windows.Add(this);
LayoutManager.Instance.ExecuteInitialLayoutPass(this);
using (BeginAutoSizing())

Loading…
Cancel
Save