-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
59 lines (59 loc) · 3.44 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
55
56
57
58
59
<Window x:Class="CefSharp.Wpf.Example.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:CefSharp.Wpf.Example.Controls"
Title="CefSharp.Wpf.Example"
WindowState="Maximized">
<Window.InputBindings>
<KeyBinding Key="T" Modifiers="Control" Command="New"/>
<KeyBinding Key="W" Modifiers="Control" Command="Close"/>
</Window.InputBindings>
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="_New Tab" Command="New"/>
<MenuItem Header="_Close Tab" Command="Close"/>
<MenuItem Header="_Exit" Command="controls:CefSharpCommands.Exit"/>
</MenuItem>
<MenuItem Header="_Tests">
<MenuItem Header="_Binding Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="BindingTest"/>
<MenuItem Header="_List Plugins" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="ListPlugins"/>
<MenuItem Header="_Popup Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="PopupTest"/>
<MenuItem Header="_Popup Test Custom Scheme" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="PopupTestCustomScheme"/>
<MenuItem Header="_Basic Scheme Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="BasicSchemeTest"/>
<MenuItem Header="_Fish Gl" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="FishGl"/>
<MenuItem Header="_Microsoft Test Drive" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="MsTestDrive"/>
<MenuItem Header="_Drag Demo" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="DragDemo"/>
<MenuItem Header="Print Current tab to PDF" Command="controls:CefSharpCommands.PrintTabToPdfCommand" />
</MenuItem>
</Menu>
<controls:NonReloadingTabControl x:Name="TabControl"
Margin="0,5,0,0"
ItemsSource="{Binding BrowserTabs, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
SelectedIndex="0">
<TabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Title}"/>
<Button Content="X"
Height="20"
Width="20"
FontFamily="Courier"
FontWeight="Bold"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
Command="Close"
FontSize="10"
Padding="0"
Margin="10,0,0,0"
ToolTip="Close"/>
</StackPanel>
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<ContentControl Content="{Binding}" />
</DataTemplate>
</TabControl.ContentTemplate>
</controls:NonReloadingTabControl>
</DockPanel>
</Window>