我为Windows 10 Mobile编写应用程序
当我点击按钮时,我需要拨打电话任务。
我尝试这样做
private void TelephoneButton_Click(object sender, RoutedEventArgs e)
{
var phoneCallTask = new PhoneCallTask
{
PhoneNumber = "+380442308888",
DisplayName = "The Name goes here"
};
phoneCallTask.Show();
}
并使用此using Microsoft.Phone.Tasks;
但是在使用
Error CS0234 The type or namespace name 'Phone' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
,这在PhoneCallTask
Error CS0246 The type or namespace name 'PhoneCallTask' could not be found (are you missing a using directive or an assembly reference?)
出了什么问题以及如何拨打电话任务?
答案 0 :(得分:1)
您需要使用PhoneCallManager。 Windows.Foundation.UniversalApiContract需要参考。
然后你可以这样做:
private void TelephoneButton_Click(object sender, RoutedEventArgs e)
{
Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI("+380442308888", "The Name goes here");
}