1+ <Window xmlns =" https://github.com/avaloniaui"
2+ xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
3+ xmlns : rxui =" using:Avalonia.ReactiveUI"
4+ x : Class =" CefSharp.Avalonia.Example.MainWindow"
5+ MinWidth =" 500"
6+ MinHeight =" 300"
7+ Title =" CefSharp.Avalonia.Example" >
8+ <Window .Styles>
9+ <Style Selector =" TabControl" >
10+ <Setter Property =" Background" Value =" #F0F0F0" />
11+ </Style >
12+
13+ <Style Selector =" TabControl WrapPanel" >
14+ <Setter Property =" Background" Value =" #2B579A" />
15+ </Style >
16+
17+ <Style Selector =" TabItem" >
18+ <Setter Property =" FontSize" Value =" 16" />
19+ <Setter Property =" Height" Value =" 34" />
20+ <Setter Property =" VerticalAlignment" Value =" Center" />
21+ <Setter Property =" Background" Value =" #2B579A" />
22+ <Setter Property =" Foreground" Value =" #F0F0F0" />
23+ </Style >
24+ <Style Selector =" TabItem:pointerover" >
25+ <Setter Property =" Background" Value =" #124078" />
26+ </Style >
27+
28+ <Style Selector =" TabItem:selected" >
29+ <Setter Property =" Background" Value =" #f0f0f0" />
30+ <Setter Property =" Foreground" Value =" #2B579A" />
31+ </Style >
32+ </Window .Styles>
33+
34+ <Grid RowDefinitions =" Auto, *" >
35+ <Menu Name =" mainMenu" Grid.Row=" 0" >
36+ <MenuItem Header =" _File" >
37+ <MenuItem Header =" _New Tab" Command =" {Binding AddTab}" />
38+ <Separator />
39+ <MenuItem Header =" _Exit" Click =" OnFileExitMenuItemClick" />
40+ </MenuItem >
41+ </Menu >
42+
43+ <TabControl Name =" tabControl" Grid.Row=" 1" Items =" {Binding Tabs}" AutoScrollToSelectedItem =" True" >
44+ <TabControl .ItemTemplate>
45+ <DataTemplate >
46+ <TextBlock Text =" {Binding Header}" />
47+ </DataTemplate >
48+ </TabControl .ItemTemplate>
49+ <TabControl .ContentTemplate>
50+ <DataTemplate >
51+ <rxui : ViewModelViewHost ViewModel =" {Binding}" />
52+ </DataTemplate >
53+ </TabControl .ContentTemplate>
54+ </TabControl >
55+ </Grid >
56+ </Window >
0 commit comments