Reputation: 2230
I'd like my Windows Store App
to handle opening txt files via the "Right-Click/Open With" command of the Windows Explorer.
My app perfectly shows up in the list of available applications to use and I can click on it, but I have no idea which event I should register to in order to grab the file name & content.
Any idea?
Upvotes: 0
Views: 812
Reputation: 45
add the proper icons in the app package
and in c#, You need to handle OnFileActivated event
protected override void OnFileActivated(FileActivatedEventArgs args)
{
// TODO: Handle file activation
// The number of files received is args.Files.Size
// The first file is args.Files[0].Name
}
Upvotes: 0
Reputation: 30097
See this article on MSDN How to handle file activation
You need to handle OnFileActivated event
protected override void OnFileActivated(FileActivatedEventArgs args)
{
// TODO: Handle file activation
// The number of files received is args.Files.Size
// The first file is args.Files[0].Name
}
Upvotes: 1