Silverlight/XAML – Learning by Coding
1: <?xml version="1.0" encoding="UTF-8"?>
2: <!-- coded by Thomas Meinike 08/08 -->
3: <UserControl x:Class="sl2_tabcontrol.Page"
4: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6: xmlns:ext="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
7: Width="800" Height="600">
8:
9: <Canvas>
10:
11: <ext:TabControl Canvas.Left="30" Canvas.Top="30" Width="500" Height="350"
12: Background="#EEE" FontFamily="Arial" FontSize="14"
13: TabStripPlacement="Top"><!-- TabStripPlacement="Bottom|Left|Right|Top" -->
14:
15: <ext:TabItem Header="Tab 1">
16: <TextBlock Text="Inhalt von Tab 1 ..."/>
17: </ext:TabItem>
18:
19: <ext:TabItem Header="Tab 2">
20: <TextBlock Text="Inhalt von Tab 2 ..."/>
21: </ext:TabItem>
22:
23: <ext:TabItem><!-- zusätzliches Grafikobjekt im TabItem-Header -->
24: <ext:TabItem.Header>
25: <StackPanel Orientation="Horizontal">
26: <Ellipse Width="5" Height="5" Fill="#F00"/>
27: <TextBlock Text="Tab 3"/>
28: </StackPanel>
29: </ext:TabItem.Header>
30:
31: <TextBlock Text="Inhalt von Tab 3 ..."/>
32: </ext:TabItem>
33:
34: </ext:TabControl>
35:
36: </Canvas>
37:
38: </UserControl>
[zum Anfang]