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 universal Win 10 applications you should use

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

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

But when I add Windows.ApplicationModel.Calls; I cannot use PhoneCallManager because there is no callmanager ..

I activated the capabilities of the phone call.

Visual Studio 2015 Windows Universal APP C # XAML Thanks

+7
c # windows win-universal-app
source share
1 answer

As indicated in your error:

A type name PhoneCallManager cannot be found in the Windows.ApplicationModel.Calls namespace. This type was redirected to the Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime assembly Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime . Consider adding a link to this assembly.

So, you need to add a link (see MSDN: How to add or remove links using the Add Link dialog box ) to the Windows.Foundation.UniversalApiContract assembly.

If you search the Internet for β€œconsider adding a link ...”, you will find you need to link to the Windows 10 SDK, not the Windows Phone 8.1 SDK.

The link you must add for this assembly is located in the "Universal Windows" β†’ "Extensions" section and is called "Windows Mobile Extensions for UWP".

+11
source share

All Articles