Browse Source

Window.Windows is now Window.OpenWindows, exposed as IList and corrected code standards.

pull/480/head
Dan Walmsley 11 years ago
parent
commit
9e0e0905af
  1. 12
      src/Perspex.Controls/Window.cs

12
src/Perspex.Controls/Window.cs

@ -47,19 +47,19 @@ 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> windows = new List<Window>(); private static IList<Window> s_windows = new List<Window>();
/// <summary> /// <summary>
/// Retrieves an enumeration of all Windows in the currently running application. /// Retrieves an enumeration of all Windows in the currently running application.
/// Can only be accessed from the UI Thread. /// Can only be accessed from the UI Thread.
/// </summary> /// </summary>
public static IEnumerable<Window> Windows public static IList<Window> OpenWindows
{ {
get get
{ {
Dispatcher.UIThread.VerifyAccess(); Dispatcher.UIThread.VerifyAccess();
return windows; return s_windows;
} }
} }
@ -172,7 +172,7 @@ namespace Perspex.Controls
/// </summary> /// </summary>
public void Close() public void Close()
{ {
windows.Remove(this); s_windows.Remove(this);
PlatformImpl.Dispose(); PlatformImpl.Dispose();
} }
@ -213,7 +213,7 @@ namespace Perspex.Controls
/// </summary> /// </summary>
public void Show() public void Show()
{ {
windows.Add(this); s_windows.Add(this);
LayoutManager.Instance.ExecuteInitialLayoutPass(this); LayoutManager.Instance.ExecuteInitialLayoutPass(this);
@ -245,7 +245,7 @@ namespace Perspex.Controls
/// </returns> /// </returns>
public Task<TResult> ShowDialog<TResult>() public Task<TResult> ShowDialog<TResult>()
{ {
windows.Add(this); s_windows.Add(this);
LayoutManager.Instance.ExecuteInitialLayoutPass(this); LayoutManager.Instance.ExecuteInitialLayoutPass(this);

Loading…
Cancel
Save