Changing UWP project's Target Version from 1803 to 1809 disables NavigationView's Acrylic texture - why?

纵然是瞬间 提交于 2019-12-07 23:54:50

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!