Trying to follow the Tutorial mentioned : XAML in Xamarin.Forms (XAM120) and getting this error
PhonewordPhonewordPhoneword.UWPPhoneDialer.UWP.cs(21,17,21,33): error CS0103: The name ‘PhoneCallManager’ does not exist in the current context
Code Snippet:
public Task
DialAsync(string number)
{
if (ApiInformation.IsApiContractPresent(“Windows.ApplicationModel.Calls.CallsPhoneContract”, 1, 0))
{
Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI(number, “Phoneword”);
return Task.FromResult(true);
}
return Task.FromResult(false);
}
Solution:
Go to Visual Studio Phoneword.UWP Project
Expand the References and Delete the Windows Reference which is pointing to 8.1 binaries
Add Reference -> Universal Windows -> Extensions
Add Windows Mobile Extensions for the UWP
Replace if condition with this or appropriate version:
if(ApiInformation.IsApiContractPresent(“Windows.Foundation.UniversalApiContract”,2,0))
Thanks
Sudheer