Browse Source

Removed TabControl.SelectedContent.

Not currently needed, as Deck is responsible for displaying the selected
content.
pull/72/merge
Steven Kirk 11 years ago
parent
commit
a4680f2041
  1. 16
      Perspex.Controls/TabControl.cs
  2. 1
      Tests/Perspex.Controls.UnitTests/TabControlTests.cs

16
Perspex.Controls/TabControl.cs

@ -15,12 +15,6 @@ namespace Perspex.Controls
/// </summary>
public class TabControl : SelectingItemsControl, IReparentingHost
{
/// <summary>
/// Defines the <see cref="SelectedContent"/> property.
/// </summary>
public static readonly PerspexProperty<object> SelectedContentProperty =
PerspexProperty.Register<TabControl, object>("SelectedContent");
/// <summary>
/// Defines the <see cref="SelectedTab"/> property.
/// </summary>
@ -43,15 +37,6 @@ namespace Perspex.Controls
SelectedIndexProperty.Changed.AddClassHandler<TabControl>(x => x.SelectedIndexChanged);
}
/// <summary>
/// Gets the content of the selected tab.
/// </summary>
public object SelectedContent
{
get { return this.GetValue(SelectedContentProperty); }
private set { this.SetValue(SelectedContentProperty, value); }
}
/// <summary>
/// Gets the <see cref="SelectedItem"/> as a <see cref="TabItem"/>.
/// </summary>
@ -94,7 +79,6 @@ namespace Perspex.Controls
var item = this.SelectedItem as IContentControl;
var content = item?.Content ?? item;
this.SelectedTab = item as TabItem;
this.SelectedContent = content;
}
}
}

1
Tests/Perspex.Controls.UnitTests/TabControlTests.cs

@ -131,7 +131,6 @@ namespace Perspex.Controls.UnitTests
// compare with former [2] now [1] == "3rd"
Assert.Same(collection[1], target.SelectedItem);
Assert.Same(target.SelectedTab, target.SelectedItem);
Assert.Equal("barf", target.SelectedContent);
}
private Control CreateTabControlTemplate(TabControl parent)

Loading…
Cancel
Save