gpt4 book ai didi

c# - 我可以检测应用程序是否正在 child 区运行吗?

转载 作者:行者123 更新时间:2023-11-30 14:13:36 25 4
gpt4 key购买 nike

我正在尝试弄清楚是否可以检测该应用程序是否在 Windows Phone 8 的 child 区中运行。

我在尝试创建辅助磁贴时遇到一个对话框弹出窗口,上面写着“当您在 child 角时,您无法更改固定到开始的内容。”如果此菜单项位于 child 区,我想将其禁用,这样使用我的应用程序的任何 child 都不会遇到这种情况。


已解决:

Windows.Phone.ApplicationModel 命名空间中的 ApplicationProfile.Modes 属性返回一个 ApplicationProfileModes 对象。我使用下面的代码并弹出对话框,并在正常屏幕中说“默认”,在 child 模式下说“备用”。

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
MessageBox.Show(messageBoxText: ApplicationProfile.Modes.ToString());
}

感谢 matthijs Hoekstra 的正确回答。

最佳答案

关于c# - 我可以检测应用程序是否正在 child 区运行吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13812507/

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