Exemple #1
0
        public override async Task OnAppearingAsync()
        {
            await _layerService.InitializeData();

            var zones = await _zoneService.GetAllZoneContractsAsync();

            ZonesList.Clear();
            foreach (var zone in zones)
            {
                var zoneUsers = _layerService.UsersInsideZone(zone.ZoneID);
                ZonesList.Add(new ZoneViewModel(zone, zoneUsers));
            }
            IsBusy = false;
        }
        public override async Task OnAppearingAsync()
        {
            await _zoneService.InitializeData();

            ZonesList.Clear();
            var zones = await _zoneService.GetAllZoneContractsAsync();

            foreach (var zone in zones)
            {
                ZonesList.Add(new ZoneViewModel(zone));
            }

            var profile = await _requestService.GetAsync <UserInfoContract>("api/UserInfoSelf");

            UserProfile = new ProfileViewModel()
            {
                UserInfo = profile
            };

            IsBusy = false;
        }
        private async Task RefreshZonesAsync()
        {
            var zones = await _zoneService.GetAllZoneContractsAsync();

            foreach (var zc in zones)
            {
                Polygon poly = new Polygon()
                {
                    FillColor   = Color.FromHex(zc.ARGBFill),
                    StrokeColor = Color.FromHex(zc.ARGBFill),
                    StrokeWidth = 1.0f,
                    Tag         = new PolygonTag()
                    {
                        PolygonTagType = PolygonTagType.Zone,
                        Tag            = zc.Description
                    }
                };
                foreach (var shape in zc.ZoneShapes.Where(z => z.Order > 0).OrderBy(z => z.Order))
                {
                    poly.Positions.Add(new Position(shape.Latitude, shape.Longitude));
                }
                Polygons.Add(poly);
            }
        }