phonecallTask​​无法在Windows Phone 8中运行

时间:2014-01-17 12:21:11

标签: c# windows-phone-8

PhoneCallTask在Windows Phone 8中无效。

我已关注this blog和此youtube video,但代码无法在我的Windows手机8上运行。

代码是:

PhoneCallTask phoneCallTask = new PhoneCallTask();       
phoneCallTask.PhoneNumber = "9021332536";
phoneCallTask.DisplayName = "Rehan";
phoneCallTask.Show();

2 个答案:

答案 0 :(得分:2)

一种解决方案是添加PhoneCallTask​​:

 PhoneCallTask callTask = new PhoneCallTask();
 callTask.PhoneNumber = "999999";
 callTask.DisplayName = "Support";
 callTask.Show();

请记住在WMAppManifest.xml中启用ID_CAP_PHONEDIALER

答案 1 :(得分:1)

尝试使用:

new PhoneCallTask
{
     DisplayName = "My name", PhoneNumber = "My phone number"
}.Show();

并且不要忘记在WMAppManifest.xml中启用“ID_CAP_PHONEDIALER”(展开属性)。