-
Notifications
You must be signed in to change notification settings - Fork 517
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
335 lines (329 loc) · 37.4 KB
/
MainWindow.xaml
File metadata and controls
335 lines (329 loc) · 37.4 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<!--
Copyright (C) Microsoft Corporation. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<Window x:Class="WebView2WpfBrowser.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:local="clr-namespace:WebView2WpfBrowser"
x:Name="MyWindow"
Title="MainWindow"
Height="450"
Width="800"
>
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</Window.Resources>
<Window.CommandBindings>
<CommandBinding Command="ApplicationCommands.New" Executed="NewCmdExecuted"/>
<CommandBinding Command="ApplicationCommands.Close" Executed="CloseCmdExecuted"/>
<CommandBinding Command="NavigationCommands.BrowseBack" Executed="BackCmdExecuted" CanExecute="BackCmdCanExecute"/>
<CommandBinding Command="NavigationCommands.BrowseForward" Executed="ForwardCmdExecuted" CanExecute="ForwardCmdCanExecute"/>
<CommandBinding Command="NavigationCommands.Refresh" Executed="RefreshCmdExecuted" CanExecute="RefreshCmdCanExecute"/>
<CommandBinding Command="NavigationCommands.BrowseStop" Executed="BrowseStopCmdExecuted" CanExecute="BrowseStopCmdCanExecute"/>
<CommandBinding Command="NavigationCommands.GoToPage" Executed="GoToPageCmdExecuted" CanExecute="GoToPageCmdCanExecute"/>
<CommandBinding Command="NavigationCommands.IncreaseZoom" Executed="IncreaseZoomCmdExecuted" CanExecute="WebViewRequiringCmdsCanExecute"/>
<CommandBinding Command="NavigationCommands.DecreaseZoom" Executed="DecreaseZoomCmdExecuted" CanExecute="DecreaseZoomCmdCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.InjectScriptCommand}" Executed="InjectScriptCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.InjectScriptIFrameCommand}" Executed="InjectScriptIFrameCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.AddInitializeScriptCommand}" Executed="AddInitializeScriptCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.RemoveInitializeScriptCommand}" Executed="RemoveInitializeScriptCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CallCdpMethodCommand}" Executed="CallCdpMethodCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.OpenDevToolsCommand}" Executed="OpenDevToolsCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.OpenTaskManagerCommand}" Executed="OpenTaskManagerCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.InjectScriptWithResultCommand}" Executed="InjectScriptWithResultCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.SetCustomDataPartitionCommand}" Executed="SetCustomDataPartitionCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ClearCustomDataPartitionCommand}" Executed="ClearCustomDataPartitionCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.SetUserAgentCommand}" Executed="SetUserAgentCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.GetCookiesCommand}" Executed="GetCookiesCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.DOMContentLoadedCommand}" Executed="DOMContentLoadedCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.WebMessagesCommand}" Executed="WebMessagesCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.NavigateWithWebResourceRequestCommand}" Executed="NavigateWithWebResourceRequestCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.AddOrUpdateCookieCommand}" Executed="AddOrUpdateCookieCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.DeleteCookiesCommand}" Executed="DeleteCookiesCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.DeleteAllCookiesCommand}" Executed="DeleteAllCookiesCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CustomContextMenuCommand}" Executed="CustomContextMenuCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PasswordAutosaveCommand}" Executed="PasswordAutosaveCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.GeneralAutofillCommand}" Executed="GeneralAutofillCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.NewBrowserVersionCommand}" Executed="NewBrowserVersionCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.SwipeNavigationCommand}" Executed="SwipeNavigationCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PdfToolbarSaveCommand}" Executed="PdfToolbarSaveCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.SmartScreenEnabledCommand}" Executed="SmartScreenEnabledExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.AuthenticationCommand}" Executed="AuthenticationCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ClearBrowsingDataCommand}" Executed="ClearBrowsingDataCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.FaviconChangedCommand}" Executed="FaviconChangedCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.LaunchingExternalUriSchemeCommand}" Executed="LaunchingExternalUriSchemeCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CustomServerCertificateSupportCommand}" Executed="CustomServerCertificateSupportCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ClearServerCertificateErrorActionsCommand}" Executed="ClearServerCertificateErrorActionsCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.SetDefaultDownloadPathCommand}" Executed="SetDefaultDownloadPathCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CreateDownloadsButtonCommand}" Executed="CreateDownloadsButtonCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ShowExtensionsWindowCommand}" Executed="ShowExtensionsWindowCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ToggleMuteStateCommand}" Executed="ToggleMuteStateCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PrintToPdfCommand}" Executed="PrintToPdfCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PinchZoomCommand}" Executed="PinchZoomCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CustomClientCertificateSelectionCommand}" Executed="CustomClientCertificateSelectionCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.DeferredCustomCertificateDialogCommand}" Executed="DeferredCustomCertificateDialogCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.DownloadStartingCommand}" Executed="DownloadStartingCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.BackgroundColorCommand}" Executed="BackgroundColorCmdExecuted" CanExecute="WebViewRequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.SuspendCommand}" Executed="SuspendCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ResumeCommand}" Executed="ResumeCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CheckUpdateCommand}" Executed="CheckUpdateCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.AllowExternalDropCommand}" Executed="AllowExternalDropCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PerfInfoCommand}" Executed="PerfInfoCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ProcessExtendedInfoCommand}" Executed="ProcessExtendedInfoCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.NewWindowWithOptionsCommand}" Executed="NewWindowWithOptionsCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CreateNewThreadCommand}" Executed="CreateNewThreadCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.TrackingPreventionLevelCommand}" Executed="TrackingPreventionLevelCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PrintDialogCommand}" Executed="PrintDialogCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PrintToDefaultPrinterCommand}" Executed="PrintToDefaultPrinterCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PrintToPrinterCommand}" Executed="PrintToPrinterCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PrintToPdfStreamCommand}" Executed="PrintToPdfStreamCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.SharedBufferRequestedCommand}" Executed="SharedBufferRequestedCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.AboutCommand}" Executed="AboutCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CrashBrowserProcessCommand}" Executed="CrashBrowserProcessCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CrashRenderProcessCommand}" Executed="CrashRenderProcessCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.GetDocumentTitleCommand}" Executed="GetDocumentTitleCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.GetUserDataFolderCommand}" Executed="GetUserDataFolderCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PostMessageStringCommand}" Executed="PostMessageStringCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PostMessageJSONCommand}" Executed="PostMessageJSONCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.HostObjectsAllowedCommand}" Executed="HostObjectsAllowedCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.BrowserAcceleratorKeyEnabledCommand}" Executed="BrowserAcceleratorKeyEnabledCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.CloseWebViewCommand}" Executed="CloseWebViewCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.NewWebViewCommand}" Executed="NewWebViewCommandExecuted"/>
<CommandBinding Command="{x:Static local:MainWindow.NewWebViewCompositionControlCommand}" Executed="NewWebViewCompositionControlCommandExecuted" CanExecute="EpxerimentalCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.PermissionManagementCommand}" Executed="PermissionManagementExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.NonClientRegionSupportCommand}" Executed="NonClientRegionSupportCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.NonClientRegionSupportEnabledCommand}" Executed="NonClientRegionSupportEnabledCmdExecuted"
CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.NotificationReceivedCommand}" Executed="NotificationReceivedExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ProgrammaticSaveAsCommand}" Executed="ProgrammaticSaveAsExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ToggleSilentCommand}" Executed="ToggleSilentExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ThrottlingControlCommand}" Executed="ThrottlingControlExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<!-- #if USE_WEBVIEW2_EXPERIMENTAL -->
<CommandBinding Command="{x:Static local:MainWindow.ServiceWorkerRegisteredCommand}" Executed="ServiceWorkerRegisteredExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.GetServiceWorkerRegistrationsCommand}" Executed="GetServiceWorkerRegistrationsExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.GetServiceWorkerRegisteredForScopeCommand}" Executed="GetServiceWorkerRegisteredForScopeExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ServiceWorkerPostMessageCommand}" Executed="ServiceWorkerPostMessageExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.DedicatedWorkerCreatedCommand}" Executed="DedicatedWorkerCreatedExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.DedicatedWorkerPostMessageCommand}" Executed="DedicatedWorkerPostMessageExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.SharedWorkerManagerCommand}" Executed="SharedWorkerManagerExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.GetSharedWorkersCommand}" Executed="GetSharedWorkersExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.WebRtcUdpPortConfigCommand}" Executed="WebRtcUdpPortConfigCommandExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<!-- #endif -->
<CommandBinding Command="{x:Static local:MainWindow.ChildFrameEventsCommand}" Executed="ChildFrameEventsExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.RemoveChildFrameEventsCommand}" Executed="RemoveChildFrameEventsExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.FileExplorerCommand}" Executed="FileExplorerExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ToggleScreenCaptureEnableCommand}" Executed="TogglScreenCaptureEnabledCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.FileTypePolicyCommand}" Executed="FileTypePolicyExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.StartCommand}" Executed="StartExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.FindNextCommand}" Executed="FindNextExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.FindPreviousCommand}" Executed="FindPreviousExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.StopFindCommand}" Executed="StopFindExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.FindTermCommand}" Executed="ChangeFindTermExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.GetMatchCountCommand}" Executed="GetMatchCountExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.GetActiveMatchIndexCommand}" Executed="GetActiveMatchIndexExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ToggleCaseSensitiveCommand}" Executed="ToggleCaseSensitiveExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ToggleShouldHighlightAllMatchesCommand}" Executed="ToggleShouldHighlightAllMatchesExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ToggleShouldMatchWordCommand}" Executed="ToggleShouldMatchWordExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ToggleSuppressDefaultFindDialogCommand}" Executed="ToggleSuppressDefaultFindDialogExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
</Window.CommandBindings>
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Header="_Print to PDF">
<MenuItem Header="Portrait" Command="{x:Static local:MainWindow.PrintToPdfCommand}" CommandParameter="Portrait"/>
<MenuItem Header="Landscape" Command="{x:Static local:MainWindow.PrintToPdfCommand}" CommandParameter="Landscape"/>
</MenuItem>
<MenuItem Header="_Get Document Title" Command="{x:Static local:MainWindow.GetDocumentTitleCommand}"/>
<MenuItem Header="_Get User Data Folder" Command="{x:Static local:MainWindow.GetUserDataFolderCommand}"/>
<MenuItem x:Name="newVersionMenuItem" Header="New Browser _Version" Command="{x:Static local:MainWindow.NewBrowserVersionCommand}"/>
<MenuItem Header="_Exit" Command="ApplicationCommands.Close"/>
</MenuItem>
<MenuItem Header="_Script">
<MenuItem Header="_Inject Script..." Command="{x:Static local:MainWindow.InjectScriptCommand}"/>
<MenuItem Header="_Inject Script Into IFrame..." Command="{x:Static local:MainWindow.InjectScriptIFrameCommand}"/>
<MenuItem Header="_Inject Script With Result..." Command="{x:Static local:MainWindow.InjectScriptWithResultCommand}"/>
<MenuItem Header="_Post Message String..." Command="{x:Static local:MainWindow.PostMessageStringCommand}"/>
<MenuItem Header="_Post Message JSON..." Command="{x:Static local:MainWindow.PostMessageJSONCommand}"/>
<MenuItem Header="Add Initialize Script" Command="{x:Static local:MainWindow.AddInitializeScriptCommand}"/>
<MenuItem Header="Remove Initialize Script" Command="{x:Static local:MainWindow.RemoveInitializeScriptCommand}"/>
<Separator/>
<MenuItem Header="Call CDP Method" Command="{x:Static local:MainWindow.CallCdpMethodCommand}"/>
<Separator/>
<MenuItem Header="Open DevTools Window" Command="{x:Static local:MainWindow.OpenDevToolsCommand}"/>
<MenuItem Header="Open Task Manager Window" Command="{x:Static local:MainWindow.OpenTaskManagerCommand}"/>
<!--TODO-->
</MenuItem>
<MenuItem Header="_Window">
<MenuItem Header="_Close WebView2" Command="{x:Static local:MainWindow.CloseWebViewCommand}"/>
<MenuItem Header="_New WebView2" Command="{x:Static local:MainWindow.NewWebViewCommand}"/>
<MenuItem Header="_New WebView2CompositionControl" Command="{x:Static local:MainWindow.NewWebViewCompositionControlCommand}"/>
<MenuItem Header="_New Window" Command="ApplicationCommands.New"/>
<MenuItem Header="_New Window With Options" Command="{x:Static local:MainWindow.NewWindowWithOptionsCommand}"/>
<MenuItem Header="_Create New Thread" Command="{x:Static local:MainWindow.CreateNewThreadCommand}"/>
<!---TODO-->
</MenuItem>
<MenuItem Header="_Process">
<MenuItem Header="Crash Browser Process" Command="{x:Static local:MainWindow.CrashBrowserProcessCommand}"/>
<MenuItem Header="Crash Render Process" Command="{x:Static local:MainWindow.CrashRenderProcessCommand}"/>
<MenuItem Header="Show _Performance Info" Command="{x:Static local:MainWindow.PerfInfoCommand}"/>
<MenuItem Header="Show _Process Extended Info" Command="{x:Static local:MainWindow.ProcessExtendedInfoCommand}"/>
<!---TODO-->
</MenuItem>
<MenuItem Header="S_ettings">
<MenuItem Header="_Server Certificate Error">
<MenuItem Header="_Toggle Custom Server Certificate Support" Command="{x:Static local:MainWindow.CustomServerCertificateSupportCommand}"/>
<MenuItem Header="_Clear Server Certificate Error Actions" Command="{x:Static local:MainWindow.ClearServerCertificateErrorActionsCommand}"/>
</MenuItem>
<MenuItem Header="Set Custom Data Partition" Command="{x:Static local:MainWindow.SetCustomDataPartitionCommand}"/>
<MenuItem Header="Set _UserAgent" Command="{x:Static local:MainWindow.SetUserAgentCommand}"/>
<MenuItem Header="Toggle Allow External Drop" IsCheckable="True" IsChecked="True" Command="{x:Static local:MainWindow.AllowExternalDropCommand}"/>
<MenuItem Header="Toggle Autofill" Name ="generalAutofillEnabled" IsCheckable="True" IsChecked="True" Command="{x:Static local:MainWindow.GeneralAutofillCommand}"/>
<MenuItem Header="Toggle Browser Accelerator Key Enabled" Command="{x:Static local:MainWindow.BrowserAcceleratorKeyEnabledCommand}"/>
<MenuItem Header="Toggle Host Objects Allowed" Command="{x:Static local:MainWindow.HostObjectsAllowedCommand}"/>
<MenuItem Header="Toggle Password Autosave" Name="passwordAutosaveEnabled" IsCheckable="True" IsChecked="False" Command="{x:Static local:MainWindow.PasswordAutosaveCommand}"/>
<MenuItem Header="Toggle Pinch Zoom Enabled" Command="{x:Static local:MainWindow.PinchZoomCommand}"/>
<MenuItem Header="Toggle PDF toolbar save button" Command="{x:Static local:MainWindow.PdfToolbarSaveCommand}"/>
<MenuItem Header="Toggle Launching External URI Scheme support enabled" Name="LaunchingExternalUriSchemeEnabled" IsCheckable="True" IsChecked="False" Command="{x:Static local:MainWindow.LaunchingExternalUriSchemeCommand}"/>
<MenuItem Header="Toggle profile SmartScreen enabled" Command="{x:Static local:MainWindow.SmartScreenEnabledCommand}"/>
<MenuItem Header="Toggle Swipe Navigation Enabled" Command="{x:Static local:MainWindow.SwipeNavigationCommand}"/>
<MenuItem Header="_Tracking Prevention Level">
<MenuItem Header="_None" Command="{x:Static local:MainWindow.TrackingPreventionLevelCommand}" CommandParameter="None"/>
<MenuItem Header="_Basic" Command="{x:Static local:MainWindow.TrackingPreventionLevelCommand}" CommandParameter="Basic"/>
<MenuItem Header="_Balanced" Command="{x:Static local:MainWindow.TrackingPreventionLevelCommand}" CommandParameter="Balanced"/>
<MenuItem Header="_Strict" Command="{x:Static local:MainWindow.TrackingPreventionLevelCommand}" CommandParameter="Strict"/>
</MenuItem>
<MenuItem Header="Toggle Non-Client Region Support" Command="{x:Static local:MainWindow.NonClientRegionSupportCommand}"/>
</MenuItem>
<MenuItem Header="_View">
<MenuItem Header="Toggle _Visibility" Name="webViewVisible" IsCheckable="True" IsChecked="True" Checked="OnWebViewVisibleChecked" Unchecked="OnWebViewVisibleUnchecked"/>
<MenuItem Header="Suspend" Command="{x:Static local:MainWindow.SuspendCommand}"/>
<MenuItem Header="Resume" Command="{x:Static local:MainWindow.ResumeCommand}"/>
<MenuItem Header="_Increase Zoom" Command="NavigationCommands.IncreaseZoom"/>
<MenuItem Header="_Decrease Zoom" Command="NavigationCommands.DecreaseZoom"/>
<MenuItem Header="_BackgroundColor">
<MenuItem Header="White" Command="{x:Static local:MainWindow.BackgroundColorCommand}" CommandParameter="White"/>
<MenuItem Header="Red" Command="{x:Static local:MainWindow.BackgroundColorCommand}" CommandParameter="Red"/>
<MenuItem Header="Blue" Command="{x:Static local:MainWindow.BackgroundColorCommand}" CommandParameter="Blue"/>
<MenuItem Header="Transparent" Command="{x:Static local:MainWindow.BackgroundColorCommand}" CommandParameter="Transparent"/>
</MenuItem>
<MenuItem Header="_Create Downloads Button" Command="{x:Static local:MainWindow.CreateDownloadsButtonCommand}"/>
<MenuItem Header="Show Extensions Manager" Command="{x:Static local:MainWindow.ShowExtensionsWindowCommand}" />
</MenuItem>
<MenuItem Header="S_cenario">
<MenuItem Header="Au_thentication" Command="{x:Static local:MainWindow.AuthenticationCommand}"/>
<MenuItem Header="Check Update" Command="{x:Static local:MainWindow.CheckUpdateCommand}"/>
<MenuItem Header="_Clear Browsing Data">
<MenuItem Header="All DOM Storage" Command="{x:Static local:MainWindow.ClearBrowsingDataCommand}" CommandParameter="DOM Storage"/>
<MenuItem Header="All Profile" Command="{x:Static local:MainWindow.ClearBrowsingDataCommand}" CommandParameter="Profile"/>
<MenuItem Header="All Site" Command="{x:Static local:MainWindow.ClearBrowsingDataCommand}" CommandParameter="Site"/>
<MenuItem Header="Autofill" Command="{x:Static local:MainWindow.ClearBrowsingDataCommand}" CommandParameter="Autofill"/>
<MenuItem Header="Browsing History" Command="{x:Static local:MainWindow.ClearBrowsingDataCommand}" CommandParameter="Browsing History"/>
<MenuItem Header="Cookies" Command="{x:Static local:MainWindow.ClearBrowsingDataCommand}" CommandParameter="Cookies"/>
<MenuItem Header="Disk Cache" Command="{x:Static local:MainWindow.ClearBrowsingDataCommand}" CommandParameter="Disk Cache"/>
<MenuItem Header="Download History" Command="{x:Static local:MainWindow.ClearBrowsingDataCommand}" CommandParameter="Download History"/>
<MenuItem Header="Custom Data Partition" Command="{x:Static local:MainWindow.ClearCustomDataPartitionCommand}"/>
</MenuItem>
<MenuItem Header="_Client Certificate Requested">
<MenuItem Header="_Custom Client Certificate Selection" Command="{x:Static local:MainWindow.CustomClientCertificateSelectionCommand}"/>
<MenuItem Header="_Deferred Custom Client Certificate Selection Dialog" Command="{x:Static local:MainWindow.DeferredCustomCertificateDialogCommand}"/>
</MenuItem>
<MenuItem Header="_Cookie Management">
<MenuItem Header="_Get Cookies" Command="{x:Static local:MainWindow.GetCookiesCommand}"/>
<MenuItem Header="_Add Or Update Cookie" Command="{x:Static local:MainWindow.AddOrUpdateCookieCommand}"/>
<MenuItem Header="_Delete Cookie" Command="{x:Static local:MainWindow.DeleteCookiesCommand}"/>
<MenuItem Header="D_elete All Cookies" Command="{x:Static local:MainWindow.DeleteAllCookiesCommand}"/>
</MenuItem>
<MenuItem Header="_Custom Context Menu" Command="{x:Static local:MainWindow.CustomContextMenuCommand}"/>
<MenuItem Header="Custom Download Experience">
<MenuItem Header="_Start Deferred Download" Command="{x:Static local:MainWindow.DownloadStartingCommand}"/>
<MenuItem Header="_Set Default Download Folder Path" Command="{x:Static local:MainWindow.SetDefaultDownloadPathCommand}"/>
</MenuItem>
<!-- #if USE_WEBVIEW2_EXPERIMENTAL -->
<MenuItem Header="_WebRTC UDP Port Configuration" Command="{x:Static local:MainWindow.WebRtcUdpPortConfigCommand}"/>
<!-- #endif -->
<MenuItem Header="_Print">
<MenuItem Header="_Print dialog">
<MenuItem Header="_Browser Print Preview" Command="{x:Static local:MainWindow.PrintDialogCommand}" CommandParameter="Browser"/>
<MenuItem Header="_System Print" Command="{x:Static local:MainWindow.PrintDialogCommand}" CommandParameter="System"/>
</MenuItem>
<MenuItem Header="_Print to default printer" Command="{x:Static local:MainWindow.PrintToDefaultPrinterCommand}"/>
<MenuItem Header="_Print to printer" Command="{x:Static local:MainWindow.PrintToPrinterCommand}"/>
<MenuItem Header="_Print to Pdf Stream" Command="{x:Static local:MainWindow.PrintToPdfStreamCommand}"/>
</MenuItem>
<MenuItem Header="_DOM Content Loaded" Command="{x:Static local:MainWindow.DOMContentLoadedCommand}"/>
<MenuItem Header="_Favicon Changed Listener" Command="{x:Static local:MainWindow.FaviconChangedCommand}"/>
<MenuItem Header="Intercept _Response" IsCheckable="True" IsChecked="{Binding ElementName=MyWindow, Path=ShowNextWebResponse, Mode=TwoWay}"/>
<MenuItem Header="_Navigate With Web Resource Request" Command="{x:Static local:MainWindow.NavigateWithWebResourceRequestCommand}"/>
<MenuItem Header="_Web Messages" Command="{x:Static local:MainWindow.WebMessagesCommand}"/>
<MenuItem Header="_Shared Buffer" Command="{x:Static local:MainWindow.SharedBufferRequestedCommand}"/>
<MenuItem Header="Permission Management" Command="{x:Static local:MainWindow.PermissionManagementCommand}"/>
<MenuItem Header="_Non-Client Region Support" Command="{x:Static local:MainWindow.NonClientRegionSupportEnabledCommand}"/>
<MenuItem Header="Notification Received" Command="{x:Static local:MainWindow.NotificationReceivedCommand}"/>
<MenuItem Header="Save As">
<MenuItem Header="Toggle Silent" Command="{x:Static local:MainWindow.ToggleSilentCommand}"/>
<MenuItem Header="Programmatic Save As" Command="{x:Static local:MainWindow.ProgrammaticSaveAsCommand}"/>
</MenuItem>
<MenuItem Header="Throttling Control" Command="{x:Static local:MainWindow.ThrottlingControlCommand}"/>
<MenuItem Header="File-system explorer" Command="{x:Static local:MainWindow.FileExplorerCommand}"/>
<MenuItem Header="Toggle Screen Capture" Command="{x:Static local:MainWindow.ToggleScreenCaptureEnableCommand}"/>
<MenuItem Header="File Type Policy" Command="{x:Static local:MainWindow.FileTypePolicyCommand}"/>
<MenuItem Header="Find on Page">
<MenuItem Header="Start Find" Command="{x:Static local:MainWindow.StartCommand}"/>
<MenuItem Header="Find Next" Command="{x:Static local:MainWindow.FindNextCommand}"/>
<MenuItem Header="Find Previous" Command="{x:Static local:MainWindow.FindPreviousCommand}"/>
<MenuItem Header="Stop Find" Command="{x:Static local:MainWindow.StopFindCommand}"/>
<MenuItem Header="Find Term" Command="{x:Static local:MainWindow.FindTermCommand}"/>
<MenuItem Header="Show Match Count" Command="{x:Static local:MainWindow.GetMatchCountCommand}"/>
<MenuItem Header="Show Active Match Index" Command="{x:Static local:MainWindow.GetActiveMatchIndexCommand}"/>
<MenuItem Header="Toggle Case Sensitive" Command="{x:Static local:MainWindow.ToggleCaseSensitiveCommand}"/>
<MenuItem Header="Toggle Highlight All" Command="{x:Static local:MainWindow.ToggleShouldHighlightAllMatchesCommand}"/>
<MenuItem Header="Toggle Match Word" Command="{x:Static local:MainWindow.ToggleShouldMatchWordCommand}"/>
<MenuItem Header="Toggle Default Find Dialog" Command="{x:Static local:MainWindow.ToggleSuppressDefaultFindDialogCommand}"/>
</MenuItem>
</MenuItem>
<MenuItem Header="_Audio">
<MenuItem Header="Toggle Mute State" IsCheckable="True" IsChecked="False" Command="{x:Static local:MainWindow.ToggleMuteStateCommand}"/>
</MenuItem>
<MenuItem Header="_Help">
<MenuItem Header="About..." Command="{x:Static local:MainWindow.AboutCommand}"/>
</MenuItem>
</Menu>
<DockPanel Name="dockPanel" DockPanel.Dock="Top">
<Button DockPanel.Dock="Left" Command="NavigationCommands.BrowseBack">Back</Button>
<Button DockPanel.Dock="Left" Command="NavigationCommands.BrowseForward">Forward</Button>
<Button DockPanel.Dock="Left" Command="NavigationCommands.Refresh">Reload</Button>
<Button DockPanel.Dock="Left" Command="NavigationCommands.BrowseStop">Cancel</Button>
<Button DockPanel.Dock="Right" Command="NavigationCommands.GoToPage" CommandParameter="{Binding ElementName=url,Path=Text}">Go</Button>
<!-- We want the address bar to update based on the WebView's Source, but we don't want the WebView to navigate just from the user typing into the address bar. Therefore we use the OneWay binding mode. -->
<TextBox x:Name="url" Text="{Binding ElementName=webView2XamlElement,Path=Source,Mode=OneWay}">
<TextBox.InputBindings>
<KeyBinding Key="Return" Command="NavigationCommands.GoToPage" CommandParameter="{Binding ElementName=url,Path=Text}" />
</TextBox.InputBindings>
</TextBox>
</DockPanel>
<Grid x:Name="Layout">
<Grid.Background>
<ImageBrush ImageSource="/assets/AppStartPageBackground.png" />
</Grid.Background>
<wv2:WebView2 x:Name="webView2XamlElement">
<wv2:WebView2.CreationProperties>
<!--
By default, this CreationProperties uses the Evergreen WebView2 Runtime that's installed on the machine.
If you want to use a specific version of WebView2 Runtime, change BrowserExecutableFolder to point to the folder
with the runtime. https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#the-fixed-version-runtime-distribution-mode
-->
<wv2:CoreWebView2CreationProperties
BrowserExecutableFolder=""
AdditionalBrowserArguments="" />
</wv2:WebView2.CreationProperties>
</wv2:WebView2>
<!-- The control event handlers are set in code behind so they can be reused when replacing the control after
a WebView2 Runtime's browser process failure
-->
</Grid>
</DockPanel>
</Window>