diff --git a/Perspex.Controls/Deck.cs b/Perspex.Controls/Deck.cs
index 67d5a83c3d..286eff7736 100644
--- a/Perspex.Controls/Deck.cs
+++ b/Perspex.Controls/Deck.cs
@@ -6,57 +6,59 @@
namespace Perspex.Controls
{
- using System.Collections;
using Perspex.Animation;
- using Perspex.Controls.Generators;
using Perspex.Controls.Primitives;
using Perspex.Controls.Utils;
using Perspex.Input;
///
- /// A selecting items control that displays a single item that fills the control.
+ /// 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");
- private static readonly ItemsPanelTemplate PanelTemplate =
+ ///
+ /// The default value of for .
+ ///
+ private static readonly ItemsPanelTemplate PanelTemplate =
new ItemsPanelTemplate(() => new Panel());
+ ///
+ /// Initializes static members of the class.
+ ///
static Deck()
{
- ItemsPanelProperty.OverrideDefaultValue(typeof(Deck), PanelTemplate);
+ 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 ItemsChanged(PerspexPropertyChangedEventArgs e)
- {
- base.ItemsChanged(e);
-
- var items = this.Items;
-
- if (items != null && items.Count() > 0)
- {
- this.SelectedIndex = 0;
- }
- }
-
+ ///
protected override void OnKeyDown(KeyEventArgs e)
{
// Ignore key presses.
}
+ ///
protected override void OnPointerPressed(PointerPressEventArgs e)
{
// Ignore pointer presses.
}
+ ///
protected override void OnTemplateApplied()
{
base.OnTemplateApplied();
diff --git a/Perspex.Controls/Generators/ItemContainerGenerator.cs b/Perspex.Controls/Generators/ItemContainerGenerator.cs
index 57270966ad..af00571602 100644
--- a/Perspex.Controls/Generators/ItemContainerGenerator.cs
+++ b/Perspex.Controls/Generators/ItemContainerGenerator.cs
@@ -92,7 +92,7 @@ namespace Perspex.Controls.Generators
if (container != null)
{
result.Add(container);
- this.containers[i] = null;
+ this.containers.Remove(i);
}
}
diff --git a/Perspex.Controls/Presenters/DeckPresenter.cs b/Perspex.Controls/Presenters/DeckPresenter.cs
index f39d0b38e3..899cf86140 100644
--- a/Perspex.Controls/Presenters/DeckPresenter.cs
+++ b/Perspex.Controls/Presenters/DeckPresenter.cs
@@ -6,74 +6,132 @@
namespace Perspex.Controls.Presenters
{
+ using System;
+ using System.Collections;
+ using System.Linq;
+ using System.Reactive.Linq;
+ using System.Threading.Tasks;
using Perspex.Animation;
using Perspex.Controls.Generators;
using Perspex.Controls.Primitives;
using Perspex.Controls.Utils;
- using Perspex.Input;
using Perspex.Styling;
- using System;
- using System.Collections;
- using System.Linq;
- using System.Reactive.Linq;
+ ///
+ /// Displays pages inside an .
+ ///
public class DeckPresenter : Control, IItemsPresenter, ITemplatedControl
{
+ ///
+ /// Defines the property.
+ ///
public static readonly PerspexProperty ItemsProperty =
ItemsControl.ItemsProperty.AddOwner();
+ ///
+ /// Defines the property.
+ ///
public static readonly PerspexProperty ItemsPanelProperty =
ItemsControl.ItemsPanelProperty.AddOwner();
- public static readonly PerspexProperty