Skip to content

Commit

Permalink
fix: enable composition for webview
Browse files Browse the repository at this point in the history
  • Loading branch information
zznty committed Dec 18, 2024
1 parent 0a8d987 commit 7483b6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion MusicX/MusicX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.1.0" />
<PackageReference Include="HandyControl" Version="3.5.1" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2950-prerelease" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
14 changes: 7 additions & 7 deletions MusicX/Views/MiniAppView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
</Page.Resources>

<Grid Margin="0,0,3,0 ">
<wv2:WebView2 x:Name="WebView"
<wv2:WebView2CompositionControl x:Name="WebView"
DefaultBackgroundColor="Transparent"
AllowExternalDrop="False"
NavigationStarting="WebView_OnNavigationStarting"
NavigationCompleted="WebView_OnNavigationCompleted">
<wv2:WebView2.Style>
<Style TargetType="wv2:WebView2">
<wv2:WebView2CompositionControl.Style>
<Style TargetType="wv2:WebView2CompositionControl">
<Setter Property="Visibility" Value="Hidden" />
<Style.Triggers>
<MultiDataTrigger>
Expand All @@ -36,13 +36,13 @@
</MultiDataTrigger>
</Style.Triggers>
</Style>
</wv2:WebView2.Style>
<wv2:WebView2.CreationProperties>
</wv2:WebView2CompositionControl.Style>
<wv2:WebView2CompositionControl.CreationProperties>
<wv2:CoreWebView2CreationProperties Language="ru-RU"
AreBrowserExtensionsEnabled="False"
UserDataFolder="{Binding FullName, Mode=OneTime, Source={x:Static services:StaticService.UserDataFolder}}"/>
</wv2:WebView2.CreationProperties>
</wv2:WebView2>
</wv2:WebView2CompositionControl.CreationProperties>
</wv2:WebView2CompositionControl>

<ui:ProgressRing VerticalAlignment="Center"
HorizontalAlignment="Center"
Expand Down
12 changes: 6 additions & 6 deletions MusicX/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
},
"Microsoft.Web.WebView2": {
"type": "Direct",
"requested": "[1.0.2903.40, )",
"resolved": "1.0.2903.40",
"contentHash": "THrzYAnJgE3+cNH+9Epr44XjoZoRELdVpXlWGPs6K9C9G6TqyDfVCeVAR/Er8ljLitIUX5gaSkPsy9wRhD1sgQ=="
"requested": "[1.0.2950-prerelease, )",
"resolved": "1.0.2950-prerelease",
"contentHash": "15GH8uTwpzNi8PH5MFS5cnjJj7LxCMJXD3gfMVEiTqniKrABb8u8B8d2fLXIvnl/YlATrtkX1M+fXF2wokIiUA=="
},
"Microsoft.Windows.CsWin32": {
"type": "Direct",
Expand Down Expand Up @@ -675,9 +675,9 @@
},
"Microsoft.Web.WebView2": {
"type": "Direct",
"requested": "[1.0.2903.40, )",
"resolved": "1.0.2903.40",
"contentHash": "THrzYAnJgE3+cNH+9Epr44XjoZoRELdVpXlWGPs6K9C9G6TqyDfVCeVAR/Er8ljLitIUX5gaSkPsy9wRhD1sgQ=="
"requested": "[1.0.2950-prerelease, )",
"resolved": "1.0.2950-prerelease",
"contentHash": "15GH8uTwpzNi8PH5MFS5cnjJj7LxCMJXD3gfMVEiTqniKrABb8u8B8d2fLXIvnl/YlATrtkX1M+fXF2wokIiUA=="
},
"System.Text.Encoding.CodePages": {
"type": "Direct",
Expand Down

0 comments on commit 7483b6a

Please sign in to comment.