2015-06-18 67 views
0

我正在使用Windows 10应用程序。 Windows 10应用程序的新功能之一是同一应用程序的多个实例(窗口)的功能。我想禁用这个。有没有人找到关于这种情况的文档?如何防止Windows 10 XAML应用程序的多个实例?

+0

你检查你的项目属性?大多数时候,我发现设置周围的属性。 – MiltoxBeyond

+0

是的,我没有看到这种情况。 – Dylan

回答

0

检出清单文件中的此Instancing属性。

Instancing

+0

忘了提及这是一个UAP应用程序。 – Dylan

1

您可以覆盖OnLaunch在App.xaml.cs方法:

protected async override void OnLaunched(LaunchActivatedEventArgs e) 
    { 
     if (e.PreviousExecutionState != ApplicationExecutionState.Running) //Check if is there any instance of the App is already running 
     { 
      base.OnLaunched(e); 
     } 
    } 
相关问题