﻿using System;
using Windows.System;
using PoliceDispatcher.Models;
using PoliceDispatcher.Services;

namespace PoliceDispatcher.UWP.Services
{
    public class NavigationService : INavigateService
    {
        public async void Navigate(DispatcherAlert alert, string location)
        {
            var uri = new Uri($"bingmaps:?rtp=pos.{location}~adr.One {alert.Street}, {alert.City}, {alert.State}");
            var launcherOptions = new LauncherOptions
            {
                TargetApplicationPackageFamilyName = "Microsoft.WindowsMaps_8wekyb3d8bbwe"
            };
            await Launcher.LaunchUriAsync(uri, launcherOptions);
        }
    }
}