public AddressesPageViewModel(INavigationService navigationService, IGooglePlacesService placesService, IPlacesStorage storage)
            : base(navigationService)
        {
            Title = "Locations";

            PlacesService = placesService;
            _storage      = storage;

            SearchAddressCommand = new DelegateCommand <string>(SearchTextAsync, (t) => !string.IsNullOrWhiteSpace(t));
            PlaceSelectedCommand = new DelegateCommand <Place>(SelectedPlace, (t) => t != null);
        }
        public MapPageViewModel(IMvxNavigationService navigationService, IPlacesStorage placesStorage)
        {
            _navigationService     = navigationService;
            PlacesStorage          = placesStorage;
            SearchAddressesCommand = new MvxCommand(SearchAddresses, CanNavigateToAddressesPage);
            IsInternetAccessible   = Connectivity.NetworkAccess == NetworkAccess.Internet;

            Connectivity.ConnectivityChanged += (sender, e) =>
            {
                IsInternetAccessible = e.NetworkAccess == NetworkAccess.Internet;
                SearchAddressesCommand.RaiseCanExecuteChanged();
            };
        }
예제 #3
0
        public MapPageViewModel(INavigationService navigationService, IPageDialogService pageDialog, IPlacesStorage placesStorage)
            : base(navigationService)
        {
            _pageDialog = pageDialog;

            Title                  = "Map";
            PlacesStorage          = placesStorage;
            SearchAddressesCommand = new DelegateCommand(SearchAddresses, CanNavigateToAddressesPage);
            IsInternetAccessible   = Connectivity.NetworkAccess == NetworkAccess.Internet;

            Connectivity.ConnectivityChanged += (sender, e) =>
            {
                IsInternetAccessible = e.NetworkAccess == NetworkAccess.Internet;
                SearchAddressesCommand.RaiseCanExecuteChanged();
            };
        }
예제 #4
0
 public PlacesService(IMapper mapper, IPlacesStorage placesStorage)
 {
     _cache         = new PlacesServiceCache();
     _mapper        = mapper;
     _placesStorage = placesStorage;
 }
 public AddressesPageViewModel(IMvxNavigationService navigationService, IGooglePlacesService placesService, IPlacesStorage storage)
 {
     _navigationService = navigationService;
     PlacesService      = placesService;
     _storage           = storage;
 }