2017-03-07 50 views
1

我已經在Visual Studio 2015年我的項目一個問題:UWP不能解析ThemeResource ApplicationPageBackgroundThemeBrush

在XAML UWP

 

    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" 

無法解析ApplicationPageBackgroundThemeBrush

我試圖刪除並重新安裝可視化studio 2015,Windows SDK,重新安裝了Windows 10,但是,每個新項目都有這個錯誤。

但是,當我編譯這個項目時,這個工作很完美。

問題在於設計階段,因爲窗口透明而沒有背景。

編輯

<Page 
    x:Class="CineBase.Pagine.Home" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d"> 

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> 
     <TextBlock x:Uid="Greeting" Text="" HorizontalAlignment="Center" VerticalAlignment="Center"/> 
    </Grid> 
</Page> 

這是完整的代碼,錯誤不具有識別碼。

+0

要設置背景的控件?你能分享更多的代碼嗎? –

+0

到一個網格,但它也發生時,我創建一個新的UWP項目,而不會改變任何東西 – ZampTom

+0

這很奇怪,完全適合我..你可以嘗試執行一個完整的卸載VS 2015(我個人建議使用它的卸載程序,然後卸載相關程序使用控制面板,然後使用[此工具](https://github.com/Microsoft/VisualStudioUninstaller/releases)清除其餘部分以擺脫VS 2015),然後安裝今天發佈的VS 2017。 –

回答

0

終於我修復了這個問題,重新安裝了Windows 10 AU(不是從設置恢復,而是完全格式化的安裝)以及Visual Studio 2017的全新安裝,這是我可以找到解決問題的唯一方法。