Ejemplo n.º 1
0
        public static void Setup()
        {
            var locations = LocationDB.GetLocations();

            foreach (Location location in locations)
            {
                Monitor(location);
            }
        }
Ejemplo n.º 2
0
        //populates map with saved locations and their pins
        void LoadLocations()
        {
            var locations = LocationDB.GetLocations();

            foreach (var location in locations)
            {
                var locVM = CreateLocVM(location);
                pins.Add(locVM.MapPin, location);
                map.Pins.Add(locVM.MapPin);
            }
        }
Ejemplo n.º 3
0
        void LoadLocations()
        {
            var locList = new ObservableCollection <LocationListItemVM>();

            foreach (Location loc in LocationDB.GetLocations())
            {
                LocationListItemVM locVM = new LocationListItemVM(loc);
                locVM.Edit += (o, e) => EditLocation(((LocationListItemVM)o).location);
                locList.Add(locVM);
                locVM.Removed += (o, e) => locList.Remove(locVM);
            }
            locations.ItemsSource = locList;
        }
Ejemplo n.º 4
0
 public LocationListItemVM(Location location)
 {
     this.location = location;
     DeleteCommand = new Command(() => {
         GeofenceSetup.RemoveMonitor(location);
         LocationDB.DeleteItem(location);
         RaiseRemoved();
     }
                                 );
     EditCommand = new Command(() =>
     {
         RaiseEdit();
     });
 }
Ejemplo n.º 5
0
        public App()
        {
            InitializeComponent();
            Page page;

            LocationDB.Init();
            if (LocationDB.GetLocations().Count > 0)
            {
                page = new App2.MyLocations();
            }
            else
            {
                page = new App2.Map();
            }

            MainPage = new NavigationPage(page);
        }
Ejemplo n.º 6
0
 void Save()
 {
     LocationDB.SaveItem(Loc);
     GeofenceSetup.Monitor(Loc);
     saveCB?.Invoke();
 }