Open any kind of file with an uwp app (without file association)

后端 未结 2 1457
终归单人心
终归单人心 2021-01-15 12:59

I am making a simple uwp text editor app. I want the app to open any kind of file even without file associations declared since there are many text files which don\'t have k

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-15 13:51

    In Windows 10 2004 (build 19041) microsoft introduced uap10:FileType attribute in package manifest and by providing * as the value the app is available in open with menu of all types of files. To use this just add the following code to your manifest:

    xmlns:uap10="http://schemas.microsoft.com/appx/manifest/uap/windows10/10"
    ...
    
      
        Assets\mylogo.png
        
          .txt
          *
        
      
    
    

    This only works for Windows 10 build 19041 and above. The additional uap:FileType is necessary if app targets minimum version below 19041 to pass manifest validation, otherwise it can be omitted.

提交回复
热议问题