A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

46 lines
1.5 KiB

// -----------------------------------------------------------------------
// <copyright file="PopupRootStyle.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Themes.Default
{
using System.Linq;
using Perspex.Controls;
using Perspex.Controls.Presenters;
using Perspex.Media;
using Perspex.Styling;
public class PopupRootStyle : Styles
{
public PopupRootStyle()
{
this.AddRange(new[]
{
new Style(x => x.OfType<PopupRoot>())
{
Setters = new[]
{
new Setter(PopupRoot.TemplateProperty, ControlTemplate.Create<PopupRoot>(this.Template)),
new Setter(PopupRoot.FontFamilyProperty, "Segoe UI"),
new Setter(PopupRoot.FontSizeProperty, 12.0),
},
},
});
}
private Control Template(PopupRoot control)
{
return new Border
{
[~Border.BackgroundProperty] = control[~PopupRoot.BackgroundProperty],
Content = new ContentPresenter
{
Name = "contentPresenter",
[~ContentPresenter.ContentProperty] = control[~PopupRoot.ContentProperty],
}
};
}
}
}