Web addresses or, specifically, URIs, follow a pattern of :?=& =. The string passed to the URI constructor method follows a pattern familiar to Web developers, yet with a few differences.
#How to use void launcher 2017 code#
Taking a closer look at the code in the previous sample, there’s something familiar about the line of code that creates a URI. Starting with Windows 8, protocol launching was added to help facilitate launching apps with the option of passing along parameters. Windows has always relied on file extensions and file-type associations to determine what applications should launch when a file is run. Protocol launching enabled launching the Maps app pre-populated with a route. What, exactly, is going on here that made this so simple and why did the default Maps app automatically launch? Protocol Launching It’s quite impressive what can be done in so few lines of code. The Maps app should launch and display driving directions between Washington, D.C., and New York City along with traffic information, as shown in Figure 1.įigure 1 Driving Directions Between New York City and Washington, D.C., in the Maps App Run the solution and click on the button. Uri uri = new Uri("bingmaps:?rtp=adr.Washington,%20DC~adr.New%20York, Private async void btnLaunchMap_Click(object sender, RoutedEventArgs e) In the file, add the following code for the event handler:
In the MainPage.xaml file, add the following XAML to create a button control: For this project, the default options will be fine, so you can just click OK. Immediately afterward, a dialog box will appear asking you which version of Windows the app should target. Name the project MapLauncher and then click OK. Expand the Installed Templates | Windows | Blank App (Universal Windows). Use a Map Without Using a Map ControlĬreate a new blank UWP project in Visual Studio by choosing New Project from the File menu. Accomplishing this is easy with the Launcher class. This solution is ideal if you want to provide your users with mapping tools, but don’t wish to add complexity to your code base. For those scenarios, you can leverage the built-in Maps app. There might be cases where you don’t need or wish to embed a rich mapping solution inside your UWP app. In my last two columns, I wrote about exploring the rich functionality of the Bing Maps Control for UWP apps.
#How to use void launcher 2017 how to#
In this month’s column, I’ll explore the Launcher class and how to put it to use in your UWP apps. In fact, the UWP adds a few new features. The Universal Windows Platform (UWP) is no exception. Indeed, it’s a feature common to practically any OS. Windows has long provided the capability to programmatically launch applications from within another application. Volume 32 Number 7 Launch Other Applications from Your UWP App