Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to dial a Number in C# windows universal 10

Hy in win8 you can

using Microsoft.Phone.Tasks;
PhoneCallTask phoneCallTask = new PhoneCallTask();
phoneCallTask.PhoneNumber = "2065550123";
phoneCallTask.DisplayName = "Gage";
phoneCallTask.Show();

but in Win 10 universal apps you have to use

Windows.ApplicationModel.Calls;
Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI(PhoneNumber, DisplayName);

and in the msdn dev network there is a PhoneCallManager Class https://msdn.microsoft.com/en-us/library/windows.applicationmodel.calls.phonecallmanager.aspx

But when i add the Windows.ApplicationModel.Calls; i can't use the PhoneCallManager because there isn't any callmanager..

I activated the Phone Call Capabilities.

Visual Studio 2015 Windows Universal APP c# XAML Thanks

like image 802
TobiasB Avatar asked Sep 04 '15 11:09

TobiasB


1 Answers

As your error states:

The type name PhoneCallManager could not be found in the namespace Windows.ApplicationModel.Calls. This type has been forwarded to assembly Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime. Consider adding a reference to that assembly.

So you need to add a reference (see MSDN: How to: Add or Remove References By Using the Add Reference Dialog Box) to the assembly Windows.Foundation.UniversalApiContract.

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.

The reference you need to add for this assembly is under "Universal Windows" -> "Extensions" and is called "Windows Mobile Extensions for the UWP".

like image 84
CodeCaster Avatar answered Oct 14 '22 06:10

CodeCaster