|
|
@ -10,6 +10,7 @@ using Perspex.Layout; |
|
|
using Perspex.Media; |
|
|
using Perspex.Media; |
|
|
using Perspex.Platform; |
|
|
using Perspex.Platform; |
|
|
using Perspex.Styling; |
|
|
using Perspex.Styling; |
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
|
|
|
namespace Perspex.Controls |
|
|
namespace Perspex.Controls |
|
|
{ |
|
|
{ |
|
|
@ -44,6 +45,13 @@ namespace Perspex.Controls |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public class Window : TopLevel, IStyleable, IFocusScope, ILayoutRoot, INameScope |
|
|
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>
|
|
|
/// <summary>
|
|
|
/// Defines the <see cref="SizeToContent"/> property.
|
|
|
/// Defines the <see cref="SizeToContent"/> property.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
@ -153,6 +161,7 @@ namespace Perspex.Controls |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public void Close() |
|
|
public void Close() |
|
|
{ |
|
|
{ |
|
|
|
|
|
s_windows.Remove(this); |
|
|
PlatformImpl.Dispose(); |
|
|
PlatformImpl.Dispose(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -193,6 +202,8 @@ namespace Perspex.Controls |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public void Show() |
|
|
public void Show() |
|
|
{ |
|
|
{ |
|
|
|
|
|
s_windows.Add(this); |
|
|
|
|
|
|
|
|
LayoutManager.Instance.ExecuteInitialLayoutPass(this); |
|
|
LayoutManager.Instance.ExecuteInitialLayoutPass(this); |
|
|
|
|
|
|
|
|
using (BeginAutoSizing()) |
|
|
using (BeginAutoSizing()) |
|
|
@ -223,6 +234,8 @@ namespace Perspex.Controls |
|
|
/// </returns>
|
|
|
/// </returns>
|
|
|
public Task<TResult> ShowDialog<TResult>() |
|
|
public Task<TResult> ShowDialog<TResult>() |
|
|
{ |
|
|
{ |
|
|
|
|
|
s_windows.Add(this); |
|
|
|
|
|
|
|
|
LayoutManager.Instance.ExecuteInitialLayoutPass(this); |
|
|
LayoutManager.Instance.ExecuteInitialLayoutPass(this); |
|
|
|
|
|
|
|
|
using (BeginAutoSizing()) |
|
|
using (BeginAutoSizing()) |
|
|
|