csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
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.
39 lines
1.2 KiB
39 lines
1.2 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.Media;
|
|
using Perspex.Styling;
|
|
|
|
public class TabStripStyle : Styles
|
|
{
|
|
public TabStripStyle()
|
|
{
|
|
this.AddRange(new[]
|
|
{
|
|
new Style(x => x.OfType<TabStrip>())
|
|
{
|
|
Setters = new[]
|
|
{
|
|
new Setter(Button.TemplateProperty, ControlTemplate.Create<TabStrip>(this.Template)),
|
|
},
|
|
},
|
|
});
|
|
}
|
|
|
|
private Control Template(TabStrip control)
|
|
{
|
|
return new ItemsPresenter
|
|
{
|
|
ItemsPanel = new ItemsPanelTemplate(() => new StackPanel()),
|
|
[~ItemsPresenter.ItemsProperty] = control[~ItemsControl.ItemsProperty],
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|