question

RPraveen-8735 avatar image
0 Votes"
RPraveen-8735 asked RoyLi-MSFT edited

Files are open in the background of the UWP application on second time in hyperlink

Files are open in the background of the UWP application on second time in hyperlink

private async void Filepath_PointerPressed(object sender, PointerRoutedEventArgs e)
{
var hyper = sender as TextBlock;
var path = hyper.Text.ToString();
//string folderPath = System.IO.Path.GetDirectoryName(path);
StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(path);
await Launcher.LaunchFolderAsync(folder);
}

windows-uwp
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

How files can be open in foreground when hyperlink clicked files are opening in background in second time.

0 Votes 0 ·

I made a simple test based on your code. But I could not reproduce your issue. I put a Textblock on my page and when I pressed the Textblock, the file explorer will show in front of my test app. Then I closed the file explorer and clicked the Textblock again, the file explorer shows in front of the app. Could you please tell me your steps to reproduce this behavior?

0 Votes 0 ·

@RoyLi-MSFT Hi, 120135-image.png




Please refer the image the application is in foreground and excel file or word file in background but this issue is getting only after installed and not in local machine .First time Word or excel will open foreground and next some time started open in background.

0 Votes 0 ·
image.png (19.2 KiB)

So you are actually opening some files like .docx and .xlsx? I changed the test code to open different files as well. But every time I open a file/folder using LaunchFileAsync/Launcher.LaunchFolderAsync, the default app will always show in the front of the UWP app. I'm not running in the Visual Studio but installed the app by sidloading as you mentioned. It seems I still could not reproduce your issue. Does this happen on all of the other devices? Or it just happens on some special devices?

0 Votes 0 ·

0 Answers