我正在编写VS2013中的WP8应用程序,并且我想将ToggleSwitch
添加到我的移动应用程序中。为了实现这一点,我点击了我的项目上的“管理NuGet软件包”(最新版本),并选择了Windows Phone Toolkit
。我有以下XAML代码:WP8中的ToggleSwitch
xmlns:tool="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
<ToggleSwitch x:Name="toggleSwitch1" Header="ToggleSwitch"
OnContent="On" OffContent="Off"
Toggled="ToggleSwitch_Toggled"/>
,并且错误是: 1)The tag 'ToggleSwitch' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'.
2)The name "ToggleSwitch" does not exist in the namespace "http://schemas.microsoft.com/client/2007".
另外,WP页面上使用的语句using Microsoft.Phone.Controls.Toolkit;
以下得到一个错误:The type or namespace name 'Toolkit' does not exist in the namespace 'Microsoft.Phone.Controls' (are you missing an assembly reference?)
我该如何解决它?