|
|
@ -139,6 +139,7 @@ namespace Perspex.Controls.UnitTests |
|
|
new Item("Bar"), |
|
|
new Item("Bar"), |
|
|
new TextBlock { Text = "Baz" }, |
|
|
new TextBlock { Text = "Baz" }, |
|
|
new TabItem { Content = "Qux" }, |
|
|
new TabItem { Content = "Qux" }, |
|
|
|
|
|
new TabItem { Content = new TextBlock { Text = "Bob" } } |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
var target = new TabControl |
|
|
var target = new TabControl |
|
|
@ -168,6 +169,10 @@ namespace Perspex.Controls.UnitTests |
|
|
target.SelectedIndex = 3; |
|
|
target.SelectedIndex = 3; |
|
|
dataContext = ((TextBlock)target.GetLogicalChildren().Single()).DataContext; |
|
|
dataContext = ((TextBlock)target.GetLogicalChildren().Single()).DataContext; |
|
|
Assert.Equal("Qux", dataContext); |
|
|
Assert.Equal("Qux", dataContext); |
|
|
|
|
|
|
|
|
|
|
|
target.SelectedIndex = 4; |
|
|
|
|
|
dataContext = ((TextBlock)target.GetLogicalChildren().Single()).DataContext; |
|
|
|
|
|
Assert.Equal("Base", dataContext); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private Control CreateTabControlTemplate(TabControl parent) |
|
|
private Control CreateTabControlTemplate(TabControl parent) |
|
|
|