简体   繁体   English

ToggleSwitch在Windows Phone7.5中不起作用

[英]ToggleSwitch not worked in windowsphone7.5

I used ToggleSwitch control in windowsphone, It works fine in windowsphone7 version, takes Microsoft.Phone.Controls as a assembly reference. 我在Windowsphone中使用了ToggleSwitch控件,在Windowsphone7版本中工作正常,将Microsoft.Phone.Controls作为程序集引用。 But in the windowsphone7.5 it asks assembly reference for ToggleSwitch control, it's not included in Microsoft.Phone.Controls. 但是在Windows Phone7.5中,它要求ToggleSwitch控件的程序集引用,但Microsoft.Phone.Controls中不包含该控件。 Anyone know the assembly reference for windowsphone7.5 ToggleSwitch control. 任何人都知道Windowsphone7.5 ToggleSwitch控件的程序集参考。

The ToggleSwitch control is part of the Silverlight Toolkit , and is part of the namespace Microsoft.Phone.Controls . ToggleSwitch控件是Silverlight Toolkit的一部分,并且是名称空间Microsoft.Phone.Controls一部分。

To enable it in your project, add a reference to the toolkit dll (or better yet, use NuGet to install it), and then reference the namespace in your XAML 要在项目中启用它,请添加对工具包dll的引用(或者更好的方法是,使用NuGet进行安装),然后在XAML中引用名称空间

(I'm sure you already know this stuff, and that the actual alias you choose isn't important as long as you use the same one when adding the control to the XAML - using "toolkit" here because that's what I normally do) (我确定您已经知道这一点,并且您选择的实际别名并不重要,只要在将控件添加到XAML时使用相同的别名即可-在此处使用“工具箱”,因为这是我通常所做的事情)

xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"

and make sure your declaration of the control in the XAML includes the namespace reference... 并确保您在XAML中对控件的声明包括名称空间引用...

<toolkit:ToggleSwitch ... ><!-- more stuff here --></toolkit:ToggleSwitch>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM