public NavigationPageViewModel(Route route)
 {
     DetailsRoute         = route;
     ShowNavigation       = true;
     Title                = "Navigation";
     locationManager      = IoCManager.Resolve <ILocationManager> ();
     nearbyExhibitManager = IoCManager.Resolve <INearbyExhibitManager> ();
     FocusGps             = new Command(FocusGpsClicked);
     SkipExhibit          = new Command(SkipExhibitClicked);
 }
        public ExhibitRoutePreviewPageViewModel(Exhibit exhibit, INearbyExhibitManager nearbyExhibitManager)
        {
            this.exhibit = exhibit;
            Question     = Strings.ExhibitOrRouteNearby_Question_Part1 + " \"" + this.exhibit.Name + "\" " + Strings.ExhibitOrRouteNearby_Question_Part2;
            SetImage(exhibit.Image);

            NearbyExhibitManager = nearbyExhibitManager;
            ExhibitRouteNearby   = Strings.ExhibitRoutePreviewPage_Exhibit_Nearby_Title;
            ExhibitRouteTitle    = exhibit.Name;
            Description          = exhibit.Description == "" ? exhibit.Name : exhibit.Description;

            Confirm = new Command(AcceptExhibit);
            Decline = new Command(Deny);
        }
Example #3
0
        public ExhibitsOverviewViewModel(IReadOnlyList <Exhibit> exhibits)
        {
            if (exhibits != null)
            {
                Exhibits = new ObservableCollection <ExhibitsOverviewListItemViewModel>(
                    exhibits.Select(ex => new ExhibitsOverviewListItemViewModel(ex)));
            }

            locationManager      = IoCManager.Resolve <ILocationManager>();
            nearbyExhibitManager = IoCManager.Resolve <INearbyExhibitManager>();
            nearbyRouteManager   = IoCManager.Resolve <INearbyRouteManager>();
            var dbChangedHandler = IoCManager.Resolve <IDbChangedHandler>();

            dbChangedHandler.AddObserver(this);
            FocusGps = new Command(FocusGpsClicked);
            DownloadUpdatedData();
        }
        public ExhibitsOverviewViewModel(ExhibitSet set)
        {
            if (set != null)
            {
                DisplayedExhibitSet = set;
                ExhibitsList        = new ObservableCollection <ExhibitsOverviewListItemViewModel>();
                foreach (Exhibit exhibit in set)
                {
                    var listItem = new ExhibitsOverviewListItemViewModel(exhibit);
                    ExhibitsList.Add(listItem);
                }
            }
            ItemTappedCommand = new Command(item => NavigateToExhibitDetails(item as ExhibitsOverviewListItemViewModel));
            DisplayDistances  = false;


            locationManager      = IoCManager.Resolve <ILocationManager> ();
            nearbyExhibitManager = IoCManager.Resolve <INearbyExhibitManager> ();
            nearbyRouteManager   = IoCManager.Resolve <INearbyRouteManager>();
        }