// -----------------------------------------------------------------------
//
// Copyright 2014 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Themes.Default
{
using System.Linq;
using Perspex.Controls;
using Perspex.Controls.Presenters;
using Perspex.Controls.Primitives;
using Perspex.Controls.Templates;
using Perspex.Styling;
///
/// The default style for the control.
///
public class WindowStyle : Styles
{
///
/// Initializes a new instance of the class.
///
public WindowStyle()
{
this.AddRange(new[]
{
new Style(x => x.OfType())
{
Setters = new[]
{
new Setter(Window.TemplateProperty, new ControlTemplate(Template)),
new Setter(Window.FontFamilyProperty, "Segoe UI"),
new Setter(Window.FontSizeProperty, 12.0),
},
},
});
}
///
/// The default template for the control.
///
/// The control being styled.
/// The root of the instantiated template.
public static Control Template(Window control)
{
return new Border
{
[~Border.BackgroundProperty] = control[~Window.BackgroundProperty],
Child = new AdornerDecorator
{
Child = new ContentPresenter
{
Name = "contentPresenter",
[~ContentPresenter.ContentProperty] = control[~Window.ContentProperty],
}
}
};
}
}
}