【发布时间】:2015-02-09 01:30:23
【问题描述】:
如果我将以下代码放入框架 WinRT 应用程序中,它将不会构建主页:
<Page
x:Class="TestApp1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TestApp1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="Blue">
<Page.Resources>
<ListPickerFlyout x:Key="btnfly"/>
</Page.Resources>
<Grid>
</Grid>
</Page>
错误是:
An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in TestApp1.WindowsPhone.exe but was not handled in user code
WinRT information: Cannot create instance of type '%0' [Line: 12 Position: 42]
将 Background 标签改回 {ThemeResource ApplicationPageBackgroundThemeBrush} 可以解决此问题。
任何想法如何更改页面的背景颜色并仍然使用 ListPickerFlyout?
【问题讨论】:
标签: windows-runtime winrt-xaml win-universal-app