本文介绍了如何将AcrylicBrush应用于TitleBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ApplicationView.GetForCurrentView()。TitleBar.BackgroundColor只接受Color属性。这是否意味着I
不能将丙烯画笔直接应用于TitleBar?我相信我的平板电脑互联网浏览器上的标题栏有丙烯画效果,虽然我可能会弄错。如果有可能我想复制它,但我不知道如何。所有
帮助表示赞赏。

ApplicationView.GetForCurrentView().TitleBar.BackgroundColor will only accept a Color property. Does this mean Ican't apply an acrylic brush directly to the TitleBar? I believe the titlebar on my tablet internet browser has an acrylicbrush effect, although I could be mistaken. If it is possible I would like to replicate it, but I have no idea how. All help is appreciated.

推荐答案

根据您的描述,我想你想把AcrylicBrush应用到TitleBar。 

如果你想设置与主屏幕相同的背景,你可以直接参考官方文档,可以直接引用代码。  ;
$
地址如下:
https://docs.microsoft.com/en-us/windows/uwp/design/style/acrylic#extend-acrylic-into-the-title-bar

From your description,I think you want to apply AcrylicBrush to the TitleBar. 
If you want to set the same background as the main screen, you can refer to the official document directly, Code can be referenced directly. 
The address is as follows: https://docs.microsoft.com/en-us/windows/uwp/design/style/acrylic#extend-acrylic-into-the-title-bar.

<Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.ThemeDictionaries>
               //your AcrylicBrush
            </ResourceDictionary.ThemeDictionaries>
        </ResourceDictionary>
</Page.Resources>
// custom TitleBar
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid x:Name="AppTitleBar" Background="{ThemeResource MyAcrylicBrush}">
            //your TitleBar
        </Grid>
</Grid>




$
C#:



C#:

// Hide default title bar.
var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
coreTitleBar.ExtendViewIntoTitleBar = true;
// Set XAML element as a draggable region.
Window.Current.SetTitleBar(AppTitleBar);




您可以在
https://docs.microsoft.com/en-us/windows/uwp/design/shell/title-bar



祝你好运,


You can check out other details in https://docs.microsoft.com/en-us/windows/uwp/design/shell/title-bar
https://docs.microsoft.com/en-us/windows/uwp/design/style/acrylic.

Best regards,

Roy


这篇关于如何将AcrylicBrush应用于TitleBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-07 17:28