在 "开始" 菜单中的文件夹下对应用程序进行分组Group applications under a folder in the Start menu

重要

此功能当前可用于通过 Windows 预览体验计划开发者环分发的初步 windows 10 版本。This feature is currently available in preliminary Windows 10 builds which are distributed through the Dev Ring of the Windows Insider program. 若要启用此功能,需要至少使用版本20257。You will need at least build 20257 to enable this feature.

.MSIX 打包应用程序的清单包含一个或多个 <Application> 条目,它们是可用的入口点。The manifest of a MSIX packaged application contains one or more <Application> entries, which are the available entry points. 其中每个都将成为 "开始" 菜单中的图标。Each of them will become an icon in the Start menu.

.MSIX 包可以包含多个应用程序。A MSIX package can contain multiple applications. 另外,公司可以构建多个应用程序,这些应用程序打包为单独的 .MSIX 包,但它们属于同一套件。Alternatively, a company can build multiple applications, which are packaged as separate MSIX packages, but they all belong to the same suite. 在这两种情况下,您可能需要将 "开始" 菜单中的所有条目组合到一个文件夹下,以便在同一位置查找所有应用程序更容易。In both scenarios, you may want to group together all the entries in the Start menu under a single folder, so that for the user it's easier to find all the applications in the same place.

可以使用项的属性来实现此目标 VisualGroup VisualElementsThis goal can be achieved using the VisualGroup property of the VisualElements item. 下面是实现此更改的步骤:Here are the steps to implement this change:

  1. 使用所选的文本编辑器打开你的应用程序的清单文件。Open the manifest file of your application with a text editor of choice. 或者,如果你使用的是 .MSIX 打包工具,则可以按 "包编辑器" 中的 " 打开清单 " 按钮。Alternatively, if you're using the MSIX Packaging Tool, you can press the Open manifest button in the Package Editor.

  2. 确保 uap3 命名空间在清单的节点中声明 <Package>Make sure that the uap3 namespace is declared in the <Package> node of the manifest:

    <Package ...
         xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"  
         IgnorableNamespaces="... uap3">
        ...
    </Package>
    
  3. 找到 Applications 部分。Locate the Applications section. 在中,你将找到一个或多个 Application 条目,每个条目对应于将在 "开始" 菜单中创建的每个图标。Inside you will find one or more Application entries, one for every icon which will be created in the Start menu. 它将如下所示:This is how it will look like:

      <Applications>
          <Application>
              <VisualElements DisplayName="App1" 
                              Square150x150Logo="images/150x150.png"
                              Square44x44Logo="images/44x44.png"
                              Description="App1"
                              BackgroundColor="#777777"
                              AppListEntry="default">  
                  <uap:SplashScreen BackgroundColor="#777777"
                                    Image="images/splash.png"/>  
              </VisualElements>  
          </Application>
          <Application>
              ...
          </Application>
      </Applications>
    
  4. uap3 前缀添加到 VisualElements 部分。Add the uap3 prefix to the VisualElements section. 请记住,将其同时添加到开始标记和结束标记:Remember to add it both to the opening and ending tags:

      <Applications>
          <Application>
              <uap3:VisualElements DisplayName="App1"
                                   Square150x150Logo="images/150x150.png"
                                   Square44x44Logo="images/44x44.png"
                                   Description="App1"
                                   BackgroundColor="#777777"
                                   AppListEntry="default">  
                  <uap:SplashScreen BackgroundColor="#777777"
                                    Image="images/splash.png"/>  
              </uap3:VisualElements>  
          </Application>
          <Application>
              ...
          </Application>
      </Applications>
    
  5. 最后,将 VisualGroup 属性添加到 VisualElements 项。Finally, add the VisualGroup attribute to the VisualElements item. 对于 "值",请在 "开始" 菜单中设置要为其创建的文件夹的名称。As value, set the name you want to give to the folder that will be created in the Start menu.

      <Applications>
          <Application>
              <uap3:VisualElements DisplayName="App1"
                                   Square150x150Logo="images/150x150.png"
                                   Square44x44Logo="images/44x44.png"
                                   Description="App1"
                                   BackgroundColor="#777777"
                                   AppListEntry="default"
                                   VisualGroup="MyFolder">  
                  <uap:SplashScreen BackgroundColor="#777777"
                                    Image="images/splash.png"/>  
              </uap3:VisualElements>  
          </Application>
          <Application>
              ...
          </Application>
      </Applications>
    

现在,你可以对 <Application> 要包含在同一文件夹中的所有其他条目重复此过程。Now you can repeat the process for all the other <Application> entries that you want to include in the same folder. 另外,还可以通过相同的方式编辑包含在 .MSIX 包中的清单文件,并为该属性使用相同的值,也可以在其他应用程序中执行同样的操作 VisualGroupOptionally, you can do the same also with other applications, by simply editing the manifest file included in their MSIX package in the same way and using the same value for the VisualGroup attribute.