8 changed files with 7 additions and 72 deletions
@ -1,25 +0,0 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="DeckItem.cs" company="Steven Kirk">
|
|||
// Copyright 2015 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Controls |
|||
{ |
|||
public class DeckItem : ContentControl, ISelectable |
|||
{ |
|||
public static readonly PerspexProperty<bool> IsSelectedProperty = |
|||
PerspexProperty.Register<DeckItem, bool>("IsSelected"); |
|||
|
|||
static DeckItem() |
|||
{ |
|||
Control.PseudoClass(IsSelectedProperty, ":selected"); |
|||
} |
|||
|
|||
public bool IsSelected |
|||
{ |
|||
get { return this.GetValue(IsSelectedProperty); } |
|||
set { this.SetValue(IsSelectedProperty, value); } |
|||
} |
|||
} |
|||
} |
|||
@ -1,38 +0,0 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="DeckItemStyle.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 DeckItemStyle : Styles |
|||
{ |
|||
public DeckItemStyle() |
|||
{ |
|||
this.AddRange(new[] |
|||
{ |
|||
new Style(x => x.OfType<DeckItem>()) |
|||
{ |
|||
Setters = new[] |
|||
{ |
|||
new Setter(DeckItem.TemplateProperty, ControlTemplate.Create<DeckItem>(this.Template)), |
|||
}, |
|||
}, |
|||
}); |
|||
} |
|||
|
|||
private Control Template(DeckItem control) |
|||
{ |
|||
return new ContentPresenter |
|||
{ |
|||
[~ContentPresenter.ContentProperty] = control[~DeckItem.ContentProperty], |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue