Browse Source

Don't explicitly set ItemsControl panel orientation.

That way, can be overridden in styles and thus doesn't need to be
overridden in TabStrip.
pull/69/head
Steven Kirk 11 years ago
parent
commit
696b016cf5
  1. 2
      Perspex.Controls/ItemsControl.cs
  2. 4
      Perspex.Controls/Primitives/TabStrip.cs

2
Perspex.Controls/ItemsControl.cs

@ -23,7 +23,7 @@ namespace Perspex.Controls
{
[SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1202:ElementsMustBeOrderedByAccess", Justification = "Needs to be before or a NullReferenceException is thrown.")]
private static readonly ItemsPanelTemplate DefaultPanel =
new ItemsPanelTemplate(() => new StackPanel { Orientation = Orientation.Vertical });
new ItemsPanelTemplate(() => new StackPanel());
public static readonly PerspexProperty<IEnumerable> ItemsProperty =
PerspexProperty.Register<ItemsControl, IEnumerable>("Items");

4
Perspex.Controls/Primitives/TabStrip.cs

@ -16,13 +16,9 @@ namespace Perspex.Controls.Primitives
public static readonly PerspexProperty<TabItem> SelectedTabProperty =
TabControl.SelectedTabProperty.AddOwner<TabStrip>();
private static readonly ItemsPanelTemplate PanelTemplate = new ItemsPanelTemplate(
() => new StackPanel());
static TabStrip()
{
FocusableProperty.OverrideDefaultValue(typeof(TabStrip), false);
ItemsPanelProperty.OverrideDefaultValue(typeof(TabStrip), PanelTemplate);
}
public TabStrip()

Loading…
Cancel
Save