[UWP]关闭并重新启动UWP应用程序 [英] [UWP]Close and Re-Start UWP App

查看:172
本文介绍了[UWP]关闭并重新启动UWP应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试关闭并重新启动UWP应用。 我正在使用的代码用于正确执行该功能,但现在应用程序关闭但仍保留在TaskBar中。 我认为右键单击图标并"打开"。手动应用。 


以下是我正在使用的代码。 

     

 private async void CommandInvokedHandler(IUICommand command)
{
string tempStr = command.Label.ToString();

if(tempStr ==" Modify Practice Info")
{
Frame.Navigate(typeof(PracticeInfoPage));
}
else
{
var result = await CoreApplication.RequestRestartAsync("Application Restartmatically Programmatically");

if(result == AppRestartFailureReason.NotInForeground ||
result == AppRestartFailureReason.RestartPending ||
result == AppRestartFailureReason.Other)
{
var msgBox = new MessageDialog(" Restart Failed Close",result.ToString());
等待msgBox.ShowAsync();
}
}
}



解决方案


这是意外行为。这是我们系统中的一个已知问题。目前我们没有时间来解决这个问题。请关注Microsoft的官方网站。


感谢您在此处报告。


祝您好运,


罗伊


I'm trying to close and re-start a UWP app.  The code I'm using use to perform the function correctly, but now the app closes but remains in the TaskBar.  I muse right-click the icon and "Open" the app manually. 

Here is the code I'm using. 

     

        private async void CommandInvokedHandler(IUICommand command)
        {
            string tempStr = command.Label.ToString();

            if (tempStr == "Modify Practice Info")
            {
                Frame.Navigate(typeof(PracticeInfoPage));
            }
            else
            {
                var result = await CoreApplication.RequestRestartAsync("Application Restart Programmatically ");

                if (result == AppRestartFailureReason.NotInForeground ||
                    result == AppRestartFailureReason.RestartPending ||
                    result == AppRestartFailureReason.Other)
                {
                    var msgBox = new MessageDialog("Restart Failed Close ", result.ToString());
                    await msgBox.ShowAsync();
                }
            }
        }


解决方案

Hi,

This is unexpected behavior. It is a known issue in our system. Currently we do not have a time when this will be fixed. Please follow the official site of Microsoft.

Thank you for reporting this here.

Best regards,

Roy


这篇关于[UWP]关闭并重新启动UWP应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆