-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml
55 lines (54 loc) · 2.91 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<Window x:Class="CefSharpInListBox.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TabControl>
<TabItem Header="IExplorer">
<WebBrowser Source="http://www.google.com/" />
</TabItem>
<TabItem Header="Chrome">
<wpf:ChromiumWebBrowser Address="http://www.google.com/" />
</TabItem>
<Control.Template>
<ControlTemplate TargetType="TabControl">
<DockPanel>
<TabPanel IsItemsHost="True"
DockPanel.Dock="{TemplateBinding TabStripPlacement}" />
<ListBox ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Items}"
SelectedIndex="{TemplateBinding SelectedIndex}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Grid />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<ContentPresenter Content="{Binding Content}"
ContentTemplate="{Binding ContentTemplate}"
ContentTemplateSelector="{Binding ContentTemplateSelector}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Visibility"
Value="Hidden" />
<Style.Triggers>
<Trigger Property="IsSelected"
Value="True">
<Setter Property="Visibility"
Value="Visible" />
</Trigger>
</Style.Triggers>
</Style>
</ItemsControl.ItemContainerStyle>
</ListBox>
</DockPanel>
</ControlTemplate>
</Control.Template>
</TabControl>
</Grid>
</Window>