private void OnAnchorLocated(object sender, AnchorLocatedEvent eventArgs)
        {
            LocateAnchorStatus status = eventArgs.Status;

            if (status == LocateAnchorStatus.AlreadyTracked ||
                status == LocateAnchorStatus.Located)
            {
                this.anchorsToLocate--;
            }

            this.RunOnUiThread(() =>
            {
                if (status == LocateAnchorStatus.AlreadyTracked)
                {
                    // Nothing to do since we've already rendered any anchors we've located.
                }
                else if (status == LocateAnchorStatus.Located)
                {
                    this.RenderLocatedAnchor(eventArgs.Anchor);
                }
                else if (status == LocateAnchorStatus.NotLocatedAnchorDoesNotExist)
                {
                    this.statusText.Text = "Anchor does not exist";
                }
            });
        }
예제 #2
0
        private void OnAnchorLocated(object sender, AnchorLocatedEvent anchorLocatedEvent)
        {
            if (OnAnchorDiscovered == null)
            {
                return;
            }

            if (anchorLocatedEvent.Status == LocateAnchorStatus.Located)
            {
                MainThread.BeginInvokeOnMainThread(() =>
                                                   OnAnchorDiscovered.Invoke(anchorLocatedEvent.Anchor));
            }
        }