@@ -16,6 +16,7 @@ found in the LICENSE file.
1616 Width =" 800"
1717 >
1818 <Window .Resources>
19+ <BooleanToVisibilityConverter x : Key =" BooleanToVisibilityConverter" />
1920 </Window .Resources>
2021 <Window .CommandBindings>
2122 <CommandBinding Command =" ApplicationCommands.New" Executed =" NewCmdExecuted" />
@@ -60,6 +61,7 @@ found in the LICENSE file.
6061 <CommandBinding Command =" {x:Static local:MainWindow.ClearServerCertificateErrorActionsCommand}" Executed =" ClearServerCertificateErrorActionsCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
6162 <CommandBinding Command =" {x:Static local:MainWindow.SetDefaultDownloadPathCommand}" Executed =" SetDefaultDownloadPathCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
6263 <CommandBinding Command =" {x:Static local:MainWindow.CreateDownloadsButtonCommand}" Executed =" CreateDownloadsButtonCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
64+ <CommandBinding Command =" {x:Static local:MainWindow.ShowExtensionsWindowCommand}" Executed =" ShowExtensionsWindowCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
6365 <CommandBinding Command =" {x:Static local:MainWindow.ToggleMuteStateCommand}" Executed =" ToggleMuteStateCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
6466 <CommandBinding Command =" {x:Static local:MainWindow.PrintToPdfCommand}" Executed =" PrintToPdfCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
6567 <CommandBinding Command =" {x:Static local:MainWindow.PinchZoomCommand}" Executed =" PinchZoomCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
@@ -94,7 +96,8 @@ found in the LICENSE file.
9496 <CommandBinding Command =" {x:Static local:MainWindow.BrowserAcceleratorKeyEnabledCommand}" Executed =" BrowserAcceleratorKeyEnabledCommandExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
9597
9698 <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" />
98101
99102 <CommandBinding Command =" {x:Static local:MainWindow.PermissionManagementCommand}" Executed =" PermissionManagementExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
100103 <CommandBinding Command =" {x:Static local:MainWindow.NonClientRegionSupportCommand}" Executed =" NonClientRegionSupportCmdExecuted" CanExecute =" CoreWebView2RequiringCmdsCanExecute" />
@@ -136,8 +139,9 @@ found in the LICENSE file.
136139 <!-- TODO-->
137140 </MenuItem >
138141 <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}" />
141145 <MenuItem Header =" _New Window" Command =" ApplicationCommands.New" />
142146 <MenuItem Header =" _New Window With Options" Command =" {x:Static local:MainWindow.NewWindowWithOptionsCommand}" />
143147 <MenuItem Header =" _Create New Thread" Command =" {x:Static local:MainWindow.CreateNewThreadCommand}" />
@@ -176,7 +180,7 @@ found in the LICENSE file.
176180 <MenuItem Header =" Toggle Non-Client Region Support" Command =" {x:Static local:MainWindow.NonClientRegionSupportCommand}" />
177181 </MenuItem >
178182 <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 " />
180184 <MenuItem Header =" Suspend" Command =" {x:Static local:MainWindow.SuspendCommand}" />
181185 <MenuItem Header =" Resume" Command =" {x:Static local:MainWindow.ResumeCommand}" />
182186 <MenuItem Header =" _Increase Zoom" Command =" NavigationCommands.IncreaseZoom" />
@@ -188,6 +192,7 @@ found in the LICENSE file.
188192 <MenuItem Header =" Transparent" Command =" {x:Static local:MainWindow.BackgroundColorCommand}" CommandParameter =" Transparent" />
189193 </MenuItem >
190194 <MenuItem Header =" _Create Downloads Button" Command =" {x:Static local:MainWindow.CreateDownloadsButtonCommand}" />
195+ <MenuItem Header =" Show Extensions Manager" Command =" {x:Static local:MainWindow.ShowExtensionsWindowCommand}" />
191196 </MenuItem >
192197 <MenuItem Header =" S_cenario" >
193198 <MenuItem Header =" Au_thentication" Command =" {x:Static local:MainWindow.AuthenticationCommand}" />
@@ -259,7 +264,7 @@ found in the LICENSE file.
259264 <Button DockPanel.Dock=" Left" Command =" NavigationCommands.BrowseStop" >Cancel</Button >
260265 <Button DockPanel.Dock=" Right" Command =" NavigationCommands.GoToPage" CommandParameter =" {Binding ElementName=url,Path=Text}" >Go</Button >
261266 <!-- 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}" >
263268 <TextBox .InputBindings>
264269 <KeyBinding Key =" Return" Command =" NavigationCommands.GoToPage" CommandParameter =" {Binding ElementName=url,Path=Text}" />
265270 </TextBox .InputBindings>
@@ -270,14 +275,18 @@ found in the LICENSE file.
270275 <ImageBrush ImageSource =" /assets/AppStartPageBackground.png" />
271276 </Grid .Background>
272277
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 >
281290 <!-- The control event handlers are set in code behind so they can be reused when replacing the control after
282291 a WebView2 Runtime's browser process failure
283292 -->
0 commit comments