// -----------------------------------------------------------------------
//
// Copyright 2015 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Controls
{
using Perspex.Animation;
using Perspex.Controls.Primitives;
using Perspex.Controls.Templates;
using Perspex.Controls.Utils;
using Perspex.Input;
///
/// An items control that displays its items as pages that fill the control.
///
public class Deck : SelectingItemsControl
{
///
/// Defines the property.
///
public static readonly PerspexProperty TransitionProperty =
PerspexProperty.Register("Transition");
///
/// The default value of for .
///
private static readonly ITemplate PanelTemplate =
new FuncTemplate(() => new Panel());
///
/// Initializes static members of the class.
///
static Deck()
{
AutoSelectProperty.OverrideDefaultValue(true);
ItemsPanelProperty.OverrideDefaultValue(PanelTemplate);
}
///
/// Gets or sets the transition to use when moving between pages.
///
public IPageTransition Transition
{
get { return this.GetValue(TransitionProperty); }
set { this.SetValue(TransitionProperty, value); }
}
///
protected override void OnKeyDown(KeyEventArgs e)
{
// Ignore key presses.
}
///
protected override void OnPointerPressed(PointerPressEventArgs e)
{
// Ignore pointer presses.
}
///
protected override void OnTemplateApplied()
{
base.OnTemplateApplied();
}
}
}