public LocationPage()
        {
            InitializeComponent();
            BindingContext = vm = new LocationPageViewModel(DependencyService.Get <IPrinterService>());

            myMap.CustomPins = new List <CustomPin> {
                new CustomPin()
                {
                    Type     = PinType.Place,
                    Position = new Position(-8.1003067, -79.0212477),
                    Label    = "Impresiones Juanita ",
                    Address  = "Borgoños 359",
                    Id       = "sss",
                    Url      = "http://google.com"
                }, new CustomPin()
                {
                    Type     = PinType.Place,
                    Position = new Position(-8.0995317, -79.0212687),
                    Label    = "Fotocopias Petter",
                    Address  = "Av. Ejercito 991",
                    Id       = "sss",
                    Url      = "http://google.com"
                }
            };



            foreach (var item in myMap.CustomPins)
            {
                myMap.Pins.Add(item);
            }
            myMap.MoveToRegion(MapSpan.FromCenterAndRadius(
                                   new Position(-8.0998823, -79.0212474), Distance.FromMeters(500.0)));
        }
Beispiel #2
0
        public void display_appropriate_location_text_on_landing_to_second_page()
        {
            TestNavigationService testNavigationService = new TestNavigationService();
            TestLocationService   testLocationService   = new TestLocationService();

            testLocationService.LocationEnabled = true;
            var locationPageViewModel = new LocationPageViewModel(testLocationService, testNavigationService);

            if (locationPageViewModel.OnClick.CanExecute(null))
            {
                locationPageViewModel.OnClick.Execute(null);
            }

            Assert.AreEqual("Location service is enabled on device.", locationPageViewModel.LocationText);

            testLocationService.LocationEnabled = false;
            locationPageViewModel = new LocationPageViewModel(testLocationService, testNavigationService);

            if (locationPageViewModel.OnClick.CanExecute(null))
            {
                locationPageViewModel.OnClick.Execute(null);
            }

            Assert.AreEqual("Location service is unable/turned off in the device.", locationPageViewModel.LocationText);
        }
Beispiel #3
0
 public InstanceLocator()
 {
     Main               = new MainViewModel();
     ShoppingCar        = new ShoppingCarViewModel();
     Delivered          = new DeliveredViewModel();
     AppointmentPage    = new AppointmentPageViewModel();
     CallNowPage        = new CallNowPageViewModel();
     LocationPage       = new LocationPageViewModel();
     OffersPage         = new OffersPageViewModel();
     QualityPage        = new QualityPageViewModel();
     SocialNetworksPage = new SocialNetworksPageViewModel();
 }
Beispiel #4
0
        public void navigate_to_previous_page_when_back_button_is_clicked()
        {
            TestNavigationService testNavigationService = new TestNavigationService();
            TestLocationService   testLocationService   = new TestLocationService();

            var locationPageViewModel = new LocationPageViewModel(testLocationService, testNavigationService);

            if (locationPageViewModel.OnClick.CanExecute(null))
            {
                locationPageViewModel.OnClick.Execute(null);
            }

            Assert.AreEqual(typeof(MainPageViewModel), testNavigationService.ViewModel);
        }