使用Windows Phone的DatePicker控件时出现问题. [英] Problem to use Windows Phone's DatePicker control.
问题描述
我有Windows 7 Ultimate,Visual Studio 2010 Ultimate.我希望开发一个带有"DatePicker控件"的Windows Phone应用.
首先,我从"Codeplex"网站下载了"Windows Phone 7工具包",并在.xaml上添加了一个命名空间,如下所示;
Hi,
I have Windows 7 Ultimate, Visual Studio 2010 Ultimate. I have desire to develop a Windows Phone App with "DatePicker Control" into it.
First of all, I downloaded the "Windows Phone 7 toolkit" from the "Codeplex" website, and I added a namespace on .xaml as follow;
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit".
因此,要使用DatePicker控件,我在.xaml上将其编码为如下代码.
So, to use DatePicker control, I coded it as follow on .xaml.
<toolkit:DatePicker HorizontalAlignment="Left" Margin="149,219,0,0" Name="txtStartOn" VerticalAlignment="Top" Width="325" Height="55" FontFamily="Verdana" FontSize="13.333" Foreground="#FFDA4D4D" />;
在主页上我也添加了;使用Microsoft.Phone.Controls.Toolkit;
但这给了我一个错误,如下;
类型或名称空间名称"Toolkit"在名称空间"Microsoft.Phone.Control"中不存在(是否缺少程序集引用?)
之后,我手动从添加引用窗口"中将"Microsoft.Phone.Controls.Toolkit.dll"加载到我的解决方案项目中,以修复错误,并且在引用列表中可以看到"Microsoft.Phone.Controls.Toolkit.dll",但是仍然出现相同的错误.
你有什么主意吗?
在此先感谢您
In the MainPage also I added; using Microsoft.Phone.Controls.Toolkit;
But it gives me an error as follow;
The type or Namespace name "Toolkit" does not exist in the Namespace "Microsoft.Phone.Control" (Are you missing an assembly reference?)
After that, manually I loaded "Microsoft.Phone.Controls.Toolkit.dll" from "Add Reference Window" into my Solution Project to fix the error and I can see "Microsoft.Phone.Controls.Toolkit" in my references list, but still I get the same error.
Do you have any idea?
Thanks in advance
推荐答案
右键单击您的 Microsoft.Phone.Controls.Toolkit.dll 参考.转到属性,然后搜索本地副本".设置为 True .
我认为您缺少另一个dll.让我记住这一点,我将改进此解决方案;)
希望对您有所帮助.
Right click on your Microsoft.Phone.Controls.Toolkit.dll reference. Go to properties and search for Local Copy. Set to True.
I think you missing another dll. Let me remember that and I''ll improve this solution ;)
Hope it helps.
这篇关于使用Windows Phone的DatePicker控件时出现问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!