【发布时间】:2014-07-16 10:32:53
【问题描述】:
我正在 VS2013 中编写 WP8 应用程序,我想将 ToggleSwitch 添加到我的移动应用程序中。为了实现这一点,我在我的项目中单击了“管理 NuGet 包”(安装了最新版本)并选择了Windows Phone Toolkit。我有以下 XAML 代码:
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 语句 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?)
我该如何解决?
【问题讨论】:
标签: c# visual-studio xaml windows-phone-8