public PathResultsModel(Address location, Address destination, IEnumerable<PathOption> pathOptions, IBumbleApiService BumbleApi, User user)
 {
     this.BumbleApi = BumbleApi;
     this.user = user;
     this.Location = location;
     this.Destination = destination;
     this.PathOptions = pathOptions;
     int numResults = pathOptions.Where(x => !x.IsUber).Count();
     if (numResults > 0)
     {
         TripAVisibility = Visibility.Visible;
     }
     if (numResults > 1)
     {
         TripBVisibility = Visibility.Visible;
     }
     if (numResults > 2)
     {
         TripCVisibility = Visibility.Visible;
     }
     if (numResults > 3)
     {
         TripDVisibility = Visibility.Visible;
     }
     if (numResults > 4)
     {
         TripEVisibility = Visibility.Visible;
     }
 }
Exemple #2
0
        public PathResultsModel(Address location, Address destination, IEnumerable <PathOption> pathOptions, IBumbleApiService BumbleApi, User user)
        {
            this.BumbleApi   = BumbleApi;
            this.user        = user;
            this.Location    = location;
            this.Destination = destination;
            this.PathOptions = pathOptions;
            int numResults = pathOptions.Where(x => !x.IsUber).Count();

            if (numResults > 0)
            {
                TripAVisibility = Visibility.Visible;
            }
            if (numResults > 1)
            {
                TripBVisibility = Visibility.Visible;
            }
            if (numResults > 2)
            {
                TripCVisibility = Visibility.Visible;
            }
            if (numResults > 3)
            {
                TripDVisibility = Visibility.Visible;
            }
            if (numResults > 4)
            {
                TripEVisibility = Visibility.Visible;
            }
        }
        public SearchViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApiService)
            : base(ApplicationPage.Search, aggregateService)
        {
            this.timerSearch = new DispatcherTimer();
            this.timerSearch.Interval = new TimeSpan(0, 0, 1);
            this.timerSearch.Tick += TimerTickSearch;

            this.BumbleApiService = BumbleApiService;
        }
Exemple #4
0
        public SearchViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApiService)
            : base(ApplicationPage.Search, aggregateService)
        {
            this.timerSearch          = new DispatcherTimer();
            this.timerSearch.Interval = new TimeSpan(0, 0, 1);
            this.timerSearch.Tick    += TimerTickSearch;

            this.BumbleApiService = BumbleApiService;
        }
        public PlaceOfInterestViewModel(IUnitOfWork unitOfWork, IBumbleApiService BumbleApiService, AppUse appUse, INavigationService navigationService)
            : base(appUse, ApplicationPage.ExploreCity, unitOfWork, navigationService)
        {
            this.timerSearch = new DispatcherTimer();
            this.timerSearch.Interval = new TimeSpan(0, 0, 1);
            this.timerSearch.Tick += TimerTickSearch;

            this.BumbleApiService = BumbleApiService;
        }
        public PlaceOfInterestViewModel(IUnitOfWork unitOfWork, IBumbleApiService BumbleApiService, AppUse appUse, INavigationService navigationService)
            : base(appUse, ApplicationPage.ExploreCity, unitOfWork, navigationService)
        {
            this.timerSearch          = new DispatcherTimer();
            this.timerSearch.Interval = new TimeSpan(0, 0, 1);
            this.timerSearch.Tick    += TimerTickSearch;

            this.BumbleApiService = BumbleApiService;
        }
Exemple #7
0
        public TripDetailsViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApi)
            : base(ApplicationPage.TripDetails, aggregateService)
        {
            this.BumbleApi = BumbleApi;

            this.timer       = new DispatcherTimer();
            this.timer.Tick += TimerTick;

            Messenger.Default.Register <PageLoadMessage>(this, (action) => SendTripMessage(action));
        }
        public TripDetailsViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApi)
            : base(ApplicationPage.TripDetails, aggregateService)
        {
            this.BumbleApi = BumbleApi;

            this.timer = new DispatcherTimer();
            this.timer.Tick += TimerTick;

            Messenger.Default.Register<PageLoadMessage>(this, (action) => SendTripMessage(action));
        }
        public SplashScreenViewModel(IAggregateService aggregateService, IDrumbleApiService DrumbleApiService, IBumbleApiService BumbleApiService)
            : base(ApplicationPage.SplashScreen, aggregateService)
        {
            this.DrumbleApiService = DrumbleApiService;
            this.BumbleApiService  = BumbleApiService;

            Messenger.Default.Register <SplashScreenMessage>(this, (action) => SetPageState(action));

            // Seed database.
            databaseCreated = DatabaseSetup.Seed(aggregateService.UnitOfWork);
        }
Exemple #10
0
        public StationsAndPlacesOfInterestViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApiService)
            : base(ApplicationPage.Settings, aggregateService)
        {
            this.timerSearch          = new DispatcherTimer();
            this.timerSearch.Interval = new TimeSpan(0, 0, 1);
            this.timerSearch.Tick    += TimerTickSearch;

            this.timerMapMoved          = new DispatcherTimer();
            this.timerMapMoved.Interval = new TimeSpan(0, 0, 1);
            this.timerMapMoved.Tick    += TimerTickMapMoved;

            this.BumbleApiService = BumbleApiService;

            Messenger.Default.Register <StationsAndPlacesOfInterestModeMessage>(this, (action) => SetSelectionMode(action));
        }
        public StationsAndPlacesOfInterestViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApiService)
            : base(ApplicationPage.Settings, aggregateService)
        {
            this.timerSearch = new DispatcherTimer();
            this.timerSearch.Interval = new TimeSpan(0, 0, 1);
            this.timerSearch.Tick += TimerTickSearch;

            this.timerMapMoved = new DispatcherTimer();
            this.timerMapMoved.Interval = new TimeSpan(0, 0, 1);
            this.timerMapMoved.Tick += TimerTickMapMoved;

            this.BumbleApiService = BumbleApiService;

            Messenger.Default.Register<StationsAndPlacesOfInterestModeMessage>(this, (action) => SetSelectionMode(action));
        }
        public WhereToViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApiService, IUberService uberService)
            : base(ApplicationPage.WhereTo, aggregateService)
        {
            this.user = UnitOfWork.UserRepository.GetUser();
            this.BumbleApiService = BumbleApiService;
            this.uberService = uberService;

            AppCommandMessage.Send(Messages.Enums.AppCommandMessageReason.RemoveBackEntries);

            Messenger.Default.Register<RecentTripMessage>(this, (action) => SetRecentTrip(action));
            Messenger.Default.Register<FavouriteMessage>(this, (action) => SetFavourite(action));
            Messenger.Default.Register<WhereToMessage>(this, (action) => SetWhereTo(action));

            this.LocationSearchBoxModel = new SearchBoxModel(UnitOfWork, InMemoryApplicationSettingModel, this, SearchType.Location, BumbleApiService, user, NavigationService);
            this.DestinationSearchBoxModel = new SearchBoxModel(UnitOfWork, InMemoryApplicationSettingModel, this, SearchType.Destination, BumbleApiService, user, NavigationService);

            this.LocationSearchBoxModel.Changed += LocationSearchBoxModel_Changed;
            this.DestinationSearchBoxModel.Changed += LocationSearchBoxModel_Changed;

            this.LocationSearchBoxModel.SetAutoPopulateState();
        }
Exemple #13
0
        public WhereToViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApiService, IUberService uberService)
            : base(ApplicationPage.WhereTo, aggregateService)
        {
            this.user             = UnitOfWork.UserRepository.GetUser();
            this.BumbleApiService = BumbleApiService;
            this.uberService      = uberService;

            AppCommandMessage.Send(Messages.Enums.AppCommandMessageReason.RemoveBackEntries);

            Messenger.Default.Register <RecentTripMessage>(this, (action) => SetRecentTrip(action));
            Messenger.Default.Register <FavouriteMessage>(this, (action) => SetFavourite(action));
            Messenger.Default.Register <WhereToMessage>(this, (action) => SetWhereTo(action));

            this.LocationSearchBoxModel    = new SearchBoxModel(UnitOfWork, InMemoryApplicationSettingModel, this, SearchType.Location, BumbleApiService, user, NavigationService);
            this.DestinationSearchBoxModel = new SearchBoxModel(UnitOfWork, InMemoryApplicationSettingModel, this, SearchType.Destination, BumbleApiService, user, NavigationService);

            this.LocationSearchBoxModel.Changed    += LocationSearchBoxModel_Changed;
            this.DestinationSearchBoxModel.Changed += LocationSearchBoxModel_Changed;

            this.LocationSearchBoxModel.SetAutoPopulateState();
        }
Exemple #14
0
        public SearchBoxModel(IUnitOfWork unitOfWork, IInMemoryApplicationSettingModel inMemoryApplicationSettingModel, WhereToViewModel whereToViewModel, SearchType searchType, IBumbleApiService BumbleApiService, User user, INavigationService navigationService)
        {
            this.Type              = searchType;
            this.TripOptions       = new TripOptionModel();
            this.BumbleApiService  = BumbleApiService;
            this.navigationService = navigationService;
            this.user              = user;
            this.whereToViewModel  = whereToViewModel;
            this.unitOfWork        = unitOfWork;
            this.inMemoryApplicationSettingModel = inMemoryApplicationSettingModel;

            switch (searchType)
            {
            case SearchType.Location:
                this.TextLocation = AppResources.WhereToLocationTextBoxWaterMark;
                break;

            case SearchType.Destination:
                this.TextDestination = AppResources.WhereToDestinationTextBoxWaterMark;
                break;
            }
        }
Exemple #15
0
 public AnnouncementsViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApi)
     : base(ApplicationPage.Announcements, aggregateService)
 {
     this.BumbleApi = BumbleApi;
 }
 public MapPointSelectionViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApiService)
     : base(ApplicationPage.MapPointSelection, aggregateService)
 {
     this.BumbleApiService = BumbleApiService;
 }
 public MapPointSelectionViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApiService)
     : base(ApplicationPage.MapPointSelection, aggregateService)
 {
     this.BumbleApiService = BumbleApiService;
 }
        public SearchBoxModel(IUnitOfWork unitOfWork, IInMemoryApplicationSettingModel inMemoryApplicationSettingModel, WhereToViewModel whereToViewModel, SearchType searchType, IBumbleApiService BumbleApiService, User user, INavigationService navigationService)
        {
            this.Type = searchType;
            this.TripOptions = new TripOptionModel();
            this.BumbleApiService = BumbleApiService;
            this.navigationService = navigationService;
            this.user = user;
            this.whereToViewModel = whereToViewModel;
            this.unitOfWork = unitOfWork;
            this.inMemoryApplicationSettingModel = inMemoryApplicationSettingModel;

            switch (searchType)
            {
                case SearchType.Location:
                    this.TextLocation = AppResources.WhereToLocationTextBoxWaterMark;
                    break;
                case SearchType.Destination:
                    this.TextDestination = AppResources.WhereToDestinationTextBoxWaterMark;
                    break;
            }
        }
 public AnnouncementsViewModel(IAggregateService aggregateService, IBumbleApiService BumbleApi)
     : base(ApplicationPage.Announcements, aggregateService)
 {
     this.BumbleApi = BumbleApi;
 }