如何将文件类型与Windows Phone应用程序关联?

时间:2013-09-06 13:50:46

标签: windows-phone-7 windows-phone-8 windows-phone

我正在尝试将关联文件类型设置为Windows Phone应用程序,那么它的正确代码是什么?

1 个答案:

答案 0 :(得分:3)

您可以这样做,但仅适用于Windows Phone 8。

Auto-launching apps using file and URI associations for Windows Phone 8

如前所述,它由清单文件完成:

<Extensions>
   <FileTypeAssociation Name="Windows Phone SDK test file type" TaskID="_default" NavUriFragment="fileToken=%s">
       <Logos>
           <Logo Size="small" IsRelative="true">Assets/sdk-small-33x33.png</Logo>
           <Logo Size="medium" IsRelative="true">Assets/sdk-medium-69x69.png</Logo>
           <Logo Size="large" IsRelative="true">Assets/sdk-large-176x176.png</Logo>
       </Logos>
       <SupportedFileTypes>
         <FileType ContentType="application/sdk">.sdkTest1</FileType>
         <FileType ContentType="application/sdk">.sdkTest2</FileType>

       </SupportedFileTypes>
   </FileTypeAssociation>
</Extensions>