[英]UWP: DependencyProperty with DefaultValue ThemeResource
[英]UWP Cannot Resolve ThemeResource ApplicationPageBackgroundThemeBrush
我在Visual Studio 2015中的项目有问题:
在UWP的XAML中
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
无法解析ApplicationPageBackgroundThemeBrush
我尝试删除并重新安装Visual 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>
这是完整的代码,错误没有识别码。
最后我修复了这个问题,重新安装了Windows 10 AU(不是从设置恢复,而是完全格式化的安装)和Visual Studio 2017的新安装,这是我找到解决问题的唯一方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.