我正嘗試在Windows Phone 7中爲我的應用創建一個設置頁面。我創建了AppSettings類,並從我的MainPage.xaml中引用它。這是我的代碼:Xaml無法創建「X」的實例
<phone:PhoneApplicationPage
x:Class="Shapes4Kids.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ShapesSettings;assembly=Shapes4Kids"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
<local:AppSettings x:Key="appSettings"></local:AppSettings>
</phone:PhoneApplicationPage.Resources>
但在這裏我指的AppSettings的行(本地:AppSettings的線),我得到一個錯誤消息,指出「不能創建的AppSettings的實例」。
我有完全相同的問題。 – 2011-12-29 19:58:16