Skip to content

Commit be1cb96

Browse files
committed
Improve TabStrip reference page
1 parent 66e9880 commit be1cb96

File tree

2 files changed

+22
-20
lines changed
  • docs/reference/controls
  • i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls

2 files changed

+22
-20
lines changed

docs/reference/controls/tabstrip.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,36 @@ import TabStripNavigation from '/img/reference/controls/tabstrip/tabstrip-naviga
99

1010
Displays a strip of tab headers. You can use this control as a horizontal menu.
1111

12-
The tab strip is comprised `<TabItem>` elements. These are displayed in the sequence that they appear in the XAML.
12+
The `TabStrip` is comprised of `TabStripItem` children. Children are displayed in order of appearance and can be created by either a collection of `TabStripItem`s or generated by `ItemsSource`.
1313

14-
## Useful Property
14+
Unlike `TabControl`, `TabStrip` is not responsible for presenting the content of the selected tab. Instead, respond to the `SelectionChanged` event or `SelectedItem` property changes and use a separate control such as `ContentControl` to present the desired content. This allows developers full control over the displayed content, such as custom view caching.
1515

16-
You will probably use this property most often:
17-
18-
<table><thead><tr><th width="244">Property</th><th>Description</th></tr></thead><tbody><tr><td><code>TabItem.Header</code></td><td>The text for the tab.</td></tr></tbody></table>
19-
20-
## Example
16+
## Example: TabStrip with TabStripItem
2117

2218
```xml
2319
<TabStrip Margin="5">
24-
<TabItem Header="Tab 1"/>
25-
<TabItem Header="Tab 2"/>
26-
<TabItem Header="Tab 3"/>
20+
<TabStripItem>Tab 1</TabStripItem>
21+
<TabStripItem>Tab 2</TabStripItem>
22+
<TabStripItem>Tab 3</TabStripItem>
2723
</TabStrip>
2824
```
2925

3026
It looks like this running on Windows:
3127

3228
<img src={TabStripNavigation} alt="" />
3329

30+
## Example: TabStrip with ItemsSource
31+
32+
```xml
33+
<TabStrip ItemsSource="{Binding MyTabs}" SelectedItem="{Binding MySelectedItem}">
34+
<TabStrip.ItemTemplate>
35+
<DataTemplate x:DataType="vm:MyViewModel">
36+
<TextBlock Text="{Binding Header}"/>
37+
</DataTemplate>
38+
</TabStrip.ItemTemplate>
39+
</TabStrip>
40+
```
41+
3442
## More Information
3543

3644
:::info

i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/controls/tabstrip.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,15 @@ import TabStripNavigation from '/img/reference/controls/tabstrip/tabstrip-naviga
88

99
显示一条选项卡头的条带。您可以将此控件用作水平菜单。
1010

11-
选项卡条由 `<TabItem>` 元素组成。这些元素按它们在 XAML 中出现的顺序显示。
12-
13-
## 有用的属性
14-
15-
您可能最常使用此属性:
16-
17-
<table><thead><tr><th width="244">属性</th><th>描述</th></tr></thead><tbody><tr><td><code>TabItem.Header</code></td><td>选项卡的文本。</td></tr></tbody></table>
11+
选项卡条由 `<TabStripItem>` 元素组成。这些元素按它们在 XAML 中出现的顺序显示。
1812

1913
## 示例
2014

2115
```xml
2216
<TabStrip Margin="5">
23-
<TabItem Header="Tab 1"/>
24-
<TabItem Header="Tab 2"/>
25-
<TabItem Header="Tab 3"/>
17+
<TabStripItem>Tab 1</TabStripItem>
18+
<TabStripItem>Tab 2</TabStripItem>
19+
<TabStripItem>Tab 3</TabStripItem>
2620
</TabStrip>
2721
```
2822

0 commit comments

Comments
 (0)