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.
 
 
 

38 lines
1.1 KiB

// -----------------------------------------------------------------------
// <copyright file="ContentControlStyle.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.Media;
using Perspex.Styling;
public class ContentControlStyle : Styles
{
public ContentControlStyle()
{
this.AddRange(new[]
{
new Style(x => x.OfType<ContentControl>())
{
Setters = new[]
{
new Setter(Button.TemplateProperty, ControlTemplate.Create<ContentControl>(this.Template)),
},
},
});
}
private Control Template(ContentControl control)
{
return new ContentPresenter
{
[~ContentPresenter.ContentProperty] = control[~ContentControl.ContentProperty],
};
}
}
}