Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 8 Metro open website / mailto C#

I'm pretty confused. How do I open a website in the webbrowser from my metro app? And how can I open the default mail application?

In WPF on W7 I would just ran

Process.Start("mailto://whatever");

Thanks in advance

like image 516
martinyyyy Avatar asked Mar 20 '12 15:03

martinyyyy


1 Answers

Metro apps in Windows 8 do not support Process.Start. It does not exist on the System.Diagnostics namespace.

A metro application cannot launch another metro app directly.

However, there are two ways to launch apps. You can launch apps through file association or through protocol handlers (Windows.System.Launcher.LaunchUriAsync and Windows.System.Launcher.LaunchFileAsync)

Both of these should solve your problem.

Examples and documentation live out on: http://msdn.microsoft.com/en-us/library/windows/apps/windows.system.launcher.aspx

Also look at: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh779672.aspx

like image 174
Bob Delavan Avatar answered Oct 05 '22 19:10

Bob Delavan