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.
 
 
 

42 lines
1.4 KiB

// -----------------------------------------------------------------------
// <copyright file="DeckStyle.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Themes.Default
{
using Perspex.Controls;
using Perspex.Controls.Presenters;
using Perspex.Styling;
using System.Linq;
public class DeckStyle : Styles
{
public DeckStyle()
{
this.AddRange(new[]
{
new Style(x => x.OfType<Deck>())
{
Setters = new[]
{
new Setter(Deck.TemplateProperty, ControlTemplate.Create<Deck>(this.Template)),
},
},
});
}
private Control Template(Deck control)
{
return new DeckPresenter
{
Name = "itemsPresenter",
[~ItemsPresenter.ItemsProperty] = control[~Deck.ItemsProperty],
[~ItemsPresenter.ItemsPanelProperty] = control[~Deck.ItemsPanelProperty],
[~DeckPresenter.SelectedItemProperty] = control[~Deck.SelectedItemProperty],
[~DeckPresenter.TransitionProperty] = control[~Deck.TransitionProperty],
};
}
}
}