@@ -16,6 +16,7 @@ found in the LICENSE file.
16
16
Width =" 800"
17
17
>
18
18
<Window .Resources>
19
+ <BooleanToVisibilityConverter x : Key =" BooleanToVisibilityConverter" />
19
20
</Window .Resources>
20
21
<Window .CommandBindings>
21
22
<CommandBinding Command =" ApplicationCommands.New" Executed =" NewCmdExecuted" />
@@ -60,6 +61,7 @@ found in the LICENSE file.
60
61
<CommandBinding Command =" {x:Static local:MainWindow.ClearServerCertificateErrorActionsCommand}" Executed =" ClearServerCertificateErrorActionsCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
61
62
<CommandBinding Command =" {x:Static local:MainWindow.SetDefaultDownloadPathCommand}" Executed =" SetDefaultDownloadPathCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
62
63
<CommandBinding Command =" {x:Static local:MainWindow.CreateDownloadsButtonCommand}" Executed =" CreateDownloadsButtonCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
64
+ <CommandBinding Command =" {x:Static local:MainWindow.ShowExtensionsWindowCommand}" Executed =" ShowExtensionsWindowCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
63
65
<CommandBinding Command =" {x:Static local:MainWindow.ToggleMuteStateCommand}" Executed =" ToggleMuteStateCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
64
66
<CommandBinding Command =" {x:Static local:MainWindow.PrintToPdfCommand}" Executed =" PrintToPdfCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
65
67
<CommandBinding Command =" {x:Static local:MainWindow.PinchZoomCommand}" Executed =" PinchZoomCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
@@ -94,7 +96,8 @@ found in the LICENSE file.
94
96
<CommandBinding Command =" {x:Static local:MainWindow.BrowserAcceleratorKeyEnabledCommand}" Executed =" BrowserAcceleratorKeyEnabledCommandExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
95
97
96
98
<CommandBinding Command =" {x:Static local:MainWindow.CloseWebViewCommand}" Executed =" CloseWebViewCommandExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
97
- <CommandBinding Command =" {x:Static local:MainWindow.NewWebViewCommand}" Executed =" NewWebViewCommandExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
99
+ <CommandBinding Command =" {x:Static local:MainWindow.NewWebViewCommand}" Executed =" NewWebViewCommandExecuted" />
100
+ <CommandBinding Command =" {x:Static local:MainWindow.NewWebViewCompositionControlCommand}" Executed =" NewWebViewCompositionControlCommandExecuted" CanExecute =" EpxerimentalCmdsCanExecute" />
98
101
99
102
<CommandBinding Command =" {x:Static local:MainWindow.PermissionManagementCommand}" Executed =" PermissionManagementExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
100
103
<CommandBinding Command =" {x:Static local:MainWindow.NonClientRegionSupportCommand}" Executed =" NonClientRegionSupportCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
@@ -136,8 +139,9 @@ found in the LICENSE file.
136
139
<!-- TODO-->
137
140
</MenuItem >
138
141
<MenuItem Header =" _Window" >
139
- <MenuItem Header =" _Close WebView" Command =" ApplicationCommands.Close" />
140
- <MenuItem Header =" _New WebView" Command =" {x:Static local:MainWindow.NewWebViewCommand}" />
142
+ <MenuItem Header =" _Close WebView2" Command =" {x:Static local:MainWindow.CloseWebViewCommand}" />
143
+ <MenuItem Header =" _New WebView2" Command =" {x:Static local:MainWindow.NewWebViewCommand}" />
144
+ <MenuItem Header =" _New WebView2CompositionControl" Command =" {x:Static local:MainWindow.NewWebViewCompositionControlCommand}" />
141
145
<MenuItem Header =" _New Window" Command =" ApplicationCommands.New" />
142
146
<MenuItem Header =" _New Window With Options" Command =" {x:Static local:MainWindow.NewWindowWithOptionsCommand}" />
143
147
<MenuItem Header =" _Create New Thread" Command =" {x:Static local:MainWindow.CreateNewThreadCommand}" />
@@ -176,7 +180,7 @@ found in the LICENSE file.
176
180
<MenuItem Header =" Toggle Non-Client Region Support" Command =" {x:Static local:MainWindow.NonClientRegionSupportCommand}" />
177
181
</MenuItem >
178
182
<MenuItem Header =" _View" >
179
- <MenuItem Header =" Toggle _Visibility" Name =" webViewVisible" IsCheckable =" True" IsChecked =" True" />
183
+ <MenuItem Header =" Toggle _Visibility" Name =" webViewVisible" IsCheckable =" True" IsChecked =" True" Checked = " OnWebViewVisibleChecked " Unchecked = " OnWebViewVisibleUnchecked " />
180
184
<MenuItem Header =" Suspend" Command =" {x:Static local:MainWindow.SuspendCommand}" />
181
185
<MenuItem Header =" Resume" Command =" {x:Static local:MainWindow.ResumeCommand}" />
182
186
<MenuItem Header =" _Increase Zoom" Command =" NavigationCommands.IncreaseZoom" />
@@ -188,6 +192,7 @@ found in the LICENSE file.
188
192
<MenuItem Header =" Transparent" Command =" {x:Static local:MainWindow.BackgroundColorCommand}" CommandParameter =" Transparent" />
189
193
</MenuItem >
190
194
<MenuItem Header =" _Create Downloads Button" Command =" {x:Static local:MainWindow.CreateDownloadsButtonCommand}" />
195
+ <MenuItem Header =" Show Extensions Manager" Command =" {x:Static local:MainWindow.ShowExtensionsWindowCommand}" />
191
196
</MenuItem >
192
197
<MenuItem Header =" S_cenario" >
193
198
<MenuItem Header =" Au_thentication" Command =" {x:Static local:MainWindow.AuthenticationCommand}" />
@@ -259,7 +264,7 @@ found in the LICENSE file.
259
264
<Button DockPanel.Dock=" Left" Command =" NavigationCommands.BrowseStop" >Cancel</Button >
260
265
<Button DockPanel.Dock=" Right" Command =" NavigationCommands.GoToPage" CommandParameter =" {Binding ElementName=url,Path=Text}" >Go</Button >
261
266
<!-- 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. -->
262
- <TextBox x : Name =" url" Text =" {Binding ElementName=webView ,Path=Source,Mode=OneWay}" >
267
+ <TextBox x : Name =" url" Text =" {Binding ElementName=webView2XamlElement ,Path=Source,Mode=OneWay}" >
263
268
<TextBox .InputBindings>
264
269
<KeyBinding Key =" Return" Command =" NavigationCommands.GoToPage" CommandParameter =" {Binding ElementName=url,Path=Text}" />
265
270
</TextBox .InputBindings>
@@ -270,14 +275,18 @@ found in the LICENSE file.
270
275
<ImageBrush ImageSource =" /assets/AppStartPageBackground.png" />
271
276
</Grid .Background>
272
277
273
- <!-- If you want to use a specific version of WebView2 Runtime change EvergreenWebView2CreationProperties
274
- to BYOWebView2CreationProperties and follow the steps in MainWindow.xaml
275
- -->
276
- <wv2 : WebView2
277
- x : Name =" webView"
278
- CreationProperties =" {StaticResource EvergreenWebView2CreationProperties}"
279
- Source =" https://www.bing.com/"
280
- />
278
+ <wv2 : WebView2 x : Name =" webView2XamlElement" >
279
+ <wv2 : WebView2 .CreationProperties>
280
+ <!--
281
+ By default, this CreationProperties uses the Evergreen WebView2 Runtime that's installed on the machine.
282
+ If you want to use a specific version of WebView2 Runtime, change BrowserExecutableFolder to point to the folder
283
+ with the runtime. https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#the-fixed-version-runtime-distribution-mode
284
+ -->
285
+ <wv2 : CoreWebView2CreationProperties
286
+ BrowserExecutableFolder =" "
287
+ AdditionalBrowserArguments =" " />
288
+ </wv2 : WebView2 .CreationProperties>
289
+ </wv2 : WebView2 >
281
290
<!-- The control event handlers are set in code behind so they can be reused when replacing the control after
282
291
a WebView2 Runtime's browser process failure
283
292
-->
0 commit comments