-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
86 lines (86 loc) · 7.41 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<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"
xmlns:ex="clr-namespace:CefSharp.Example;assembly=CefSharp.Example"
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="_Open DevTools" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="OpenDevTools"/>
<MenuItem Header="Zoom In" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="ZoomIn"/>
<MenuItem Header="Zoom Out" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="ZoomOut"/>
<MenuItem Header="Zooom Reset" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="ZoomReset"/>
<MenuItem Header="ClearHttpAuthCredentials" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="ClearHttpAuthCredentials"/>
<MenuItem Header="_Exit" Command="controls:CefSharpCommands.Exit"/>
</MenuItem>
<MenuItem Header="_View">
<MenuItem Header="Toggle _Sidebar" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="ToggleSidebar"/>
<MenuItem Header="Toggle _Download Info" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="ToggleDownloadInfo"/>
</MenuItem>
<MenuItem Header="_Tests">
<MenuItem Header="_Binding Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.BindingTestUrl}}"/>
<MenuItem Header="_Binding Test Single" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.BindingTestSingleUrl}}"/>
<MenuItem Header="_LegacyBinding Test" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="LegacyBindingTest"/>
<MenuItem Header="_Post Message Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.PostMessageTestUrl}}"/>
<MenuItem Header="_Tooltip Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.TooltipTestUrl}}"/>
<MenuItem Header="D_rag&Drop Cursors Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.DragDropCursorsTestUrl}}"/>
<MenuItem Header="_Popup Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.PopupParentUrl}}"/>
<MenuItem Header="_Popup Test Custom Scheme" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.PopupTestUrl}}"/>
<MenuItem Header="_Basic Scheme Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.BasicSchemeTestUrl}}"/>
<MenuItem Header="_Response Filter Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.ResponseFilterTestUrl}}"/>
<MenuItem Header="_Draggable Region Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.DraggableRegionTestUrl}}"/>
<MenuItem Header="_Fish Gl" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="http://www.fishgl.com/"/>
<MenuItem Header="_Microsoft Test Drive" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="http://dev.modern.ie/testdrive/"/>
<MenuItem Header="_Drag Demo" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="http://html5demos.com/drag"/>
<MenuItem Header="_Print Current tab to PDF" Command="controls:CefSharpCommands.PrintTabToPdfCommand" />
<MenuItem Header="_Load Custom Request" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="CustomRequest" />
<MenuItem Header="_CDM/DRM Support Test" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.CdmSupportTestUrl}}"/>
<MenuItem Header="_Async JSB Task Tests" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="AsyncJsbTaskTests" />
<MenuItem Header="_Resize Hack Tests" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="ResizeHackTests" />
<MenuItem Header="_Google Service Worker Demo" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="https://googlechrome.github.io/samples/service-worker/basic/"/>
<MenuItem Header="Load Example Extension" Command="controls:CefSharpCommands.CustomCommand" CommandParameter="LoadExtension"/>
</MenuItem>
<MenuItem Header="_Chrome Urls">
<MenuItem Header="_List Internal Urls" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.ChromeInternalUrls}}"/>
<MenuItem Header="_Net Internal Urls" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.ChromeNetInternalUrls}}"/>
<MenuItem Header="_Process Internal Urls" Command="controls:CefSharpCommands.OpenTabCommand" CommandParameter="{Binding Source={x:Static ex:CefExample.ChromeProcessInternalUrls}}"/>
</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>