如何拨号在C#中的窗口通用10号 [英] How to dial a Number in C# windows universal 10
问题描述
在海兰Win8中,你可以
Hy in win8 you can
using Microsoft.Phone.Tasks;
PhoneCallTask phoneCallTask = new PhoneCallTask();
phoneCallTask.PhoneNumber = "2065550123";
phoneCallTask.DisplayName = "Gage";
phoneCallTask.Show();
但在Win 10个通用的应用程序,你必须用
but in Win 10 universal apps you have to use
Windows.ApplicationModel.Calls;
Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI(PhoneNumber, DisplayName);
和MSDN开发网络中有一个PhoneCallManager类
的 https://msdn.microsoft.com/en-us/library/windows.applicationmodel .calls.phonecallmanager.aspx
但是,当我添加了Windows.ApplicationModel.Calls;因为没有任何CallManager的..
But when i add the Windows.ApplicationModel.Calls; i can't use the PhoneCallManager because there isn't any callmanager..
我激活了电话呼叫功能我无法使用PhoneCallManager。
I activated the Phone Call Capabilities.
的Visual Studio 2015年
的Windows通用APP
C#
XAML
谢谢
Visual Studio 2015 Windows Universal APP c# XAML Thanks
推荐答案
由于您的错误状态:
类型名称 PhoneCallManager
不能在命名空间中找到 Windows.ApplicationModel.Calls
。此类型已转发到程序集 Windows.Foundation.UniversalApiContract,版本= 1.0.0.0,文化=中性公钥= NULL,则contentType = WindowsRuntime
。 。考虑加入到该程序集的引用
The type name
PhoneCallManager
could not be found in the namespaceWindows.ApplicationModel.Calls
. This type has been forwarded to assemblyWindows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime
. Consider adding a reference to that assembly.
所以,你需要添加一个引用的Windows.Foundation.UniversalApiContract 。
So you need to add a reference to Windows.Foundation.UniversalApiContract.
如果您搜索网页在考虑增加一个参考......的你会发现你需要引用的Windows 10的SDK,而在Windows Phone 8.1 SDK。
If you search the web for the "consider adding a reference...", you will find you need to reference the Windows 10 SDK, not the Windows Phone 8.1 SDK.
您需要添加该组件的参考是下万能的Windows - >扩展,并称之为Windows Mobile的扩展为UWP
The reference you need to add for this assembly is under "Universal Windows" -> "Extensions" and is called "Windows Mobile Extensions for the UWP".
这篇关于如何拨号在C#中的窗口通用10号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!