Esempio n. 1
0
        void InitializeBeacons()
        {
            StopRanging();

            if (viewModel.Quest.Major >= 0)
            {
                beaconRegion = new CLBeaconRegion(new NSUuid(viewModel.UUID), (ushort)viewModel.Quest.Major, BeaconId);
                beaconRegion.NotifyOnExit  = true;
                beaconRegion.NotifyOnEntry = true;
            }

            InvokeOnMainThread(() =>
            {
                Beacon1.Image  = Beacon2.Image = Beacon3.Image = undiscoveredBeacon;
                Beacon1.Hidden = Beacon2.Hidden = Beacon3.Hidden = true;
                SetBeaconText(false);
                for (int i = 0; i < viewModel.Quest.Beacons.Count; i++)
                {
                    beacons[i].Hidden = false;
                }

                UpdateBeacons();
                MainImage.LoadUrl(viewModel.Quest.Clue.Image);
                MainText.Text = viewModel.Quest.Clue.Message;
            });
            StartRanging();
        }