Last active
May 19, 2018 11:31
-
-
Save ciniml/eff69a048c071106ec48d85ab3f0f2c5 to your computer and use it in GitHub Desktop.
TabControl ItemsSource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Window x:Class="WpfApp1.MainWindow" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| xmlns:local="clr-namespace:WpfApp1" | |
| mc:Ignorable="d" | |
| Title="MainWindow" Height="450" Width="800"> | |
| <Grid> | |
| <TabControl ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}, Path=TabItems}"> | |
| <TabControl.ContentTemplate> | |
| <DataTemplate> | |
| <StackPanel> | |
| <TextBlock Text="Text"/> | |
| <TextBlock Text="{Binding}"/> | |
| </StackPanel> | |
| </DataTemplate> | |
| </TabControl.ContentTemplate> | |
| </TabControl> | |
| </Grid> | |
| </Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment