// -----------------------------------------------------------------------
//
// Copyright 2014 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Controls
{
using Perspex.Media;
using Perspex.Platform;
using Splat;
public class Window : TopLevel
{
public static readonly PerspexProperty TitleProperty =
PerspexProperty.Register("Title", "Window");
static Window()
{
BackgroundProperty.OverrideDefaultValue(typeof(Window), Brushes.White);
}
public Window()
: base(Locator.Current.GetService())
{
}
public new IWindowImpl PlatformImpl
{
get { return (IWindowImpl)base.PlatformImpl; }
}
public string Title
{
get { return this.GetValue(TitleProperty); }
set { this.SetValue(TitleProperty, value); }
}
public void Hide()
{
using (this.BeginAutoSizing())
{
this.PlatformImpl.Hide();
}
}
public void Show()
{
this.ExecuteLayoutPass();
using (this.BeginAutoSizing())
{
this.PlatformImpl.Show();
}
}
}
}