问题
I have an UWP project which I started to build using Target Version 1803. When I upgraded the solution to use Target Version 1809 my NavigationView's behaviour changed and the acrylic effect was gone.
As an illustration, this is what it looked like before:
And this is what it looks like now:
Why does this happen? I wouldn't believe this is to match some design guidelines since Microsoft themselves still use the acrylic effect in NavigationViews in many native UWP programs. I would also like to know if there's a way to "bring back" the acrylic to a NavigationView in a program using Target Version 1809.
回答1:
In latest version 17763, The value of NavigationViewExpandedPaneBackground change to SolidColorBrush. The following is the different between version 17134 and 17763.
17134
<StaticResource x:Key="NavigationViewExpandedPaneBackground" ResourceKey="SystemControlChromeMediumLowAcrylicWindowMediumBrush" />
17763
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="{StaticResource SystemChromeMediumColor}" />
If you want to implement acrylic effect, you could add the first StaticResource in your page resource like the following
<Page.Resources>
<StaticResource x:Key="NavigationViewExpandedPaneBackground"
ResourceKey="SystemControlChromeMediumLowAcrylicWindowMediumBrush"/>
</Page.Resources>
来源:https://stackoverflow.com/questions/53937941/changing-uwp-projects-target-version-from-1803-to-1809-disables-navigationview