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="TabStripStyle.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.Styling;
public class TabStripStyle : Styles
{
public TabStripStyle()
{
this.AddRange(new[]
{
new Style(x => x.OfType<TabStrip>())
{
Setters = new[]
{
new Setter(TabStrip.TemplateProperty, ControlTemplate.Create<TabStrip>(this.Template)),
},
},
new Style(x => x.OfType<TabStrip>().Template().OfType<StackPanel>())
{
Setters = new[]
{
new Setter(StackPanel.GapProperty, 16.0),
new Setter(StackPanel.OrientationProperty, Orientation.Horizontal),
},
},
});
}
private Control Template(TabStrip control)
{
return new ItemsPresenter
{
[~ItemsPresenter.ItemsProperty] = control[~ItemsControl.ItemsProperty],
[~ItemsPresenter.ItemsPanelProperty] = control[~ItemsControl.ItemsPanelProperty],
};
}
}
}