gpt4 book ai didi

windows-phone-7 - wp7 PhoneCallTask​​ 结果

转载 作者:行者123 更新时间:2023-12-04 07:19:34 24 4
gpt4 key购买 nike

当调用 PhoneCallTask​​ Show 时,会提示确认。
现在有没有办法知道用户是点击了“调用”还是“不调用”按钮?

例如

phoneCallTask.Cancel += () => { };

提前致谢

最佳答案

我想出了一个方法来做到这一点。如果你愿意,你也可以试试。

PhoneApplicationFrame 中有两个事件处理程序 Obscured 和 Unobscured,它们在 Shell UI 启动时被触发。

如果该人单击调用,则 Obscure 和 Unobscured 会交替触发两次。
并且柜面的人点击不要打电话,他们每个人都只被触发一次。因此,保持计数可以检测此人是否点击了“调用”

在页面的构造函数中添加这个。

(Application.Current as App).RootFrame.Obscured += OnObscured;
(Application.Current as App).RootFrame.Unobscured += OnUnobscured;

在调用 show 之前,初始化一个计数器和标志
diallerState = 1;
isDial = true;
pct.Show(); //pct = new PhoneCallTask();



void OnObscured(object sender, ObscuredEventArgs e)
{
if (diallerState == 3 && isDial == true)
{
//The user Clicked Dialled
diallerState = 0;
isDial=false;
}
else
if(isDial==true) diallerState++;
}



void OnUnobscured(object sender, EventArgs e)
{
if(isDial) diallerState++;
}

关于windows-phone-7 - wp7 PhoneCallTask​​ 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10096492/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com