Ejemplo n.º 1
0
        private static void EnableDoubleTapToast(Element element)
        {
            if (element is VisualElement visualElement)
            {
                if (element is View view)
                {
                    var tapGestureRecognizer = new TapGestureRecognizer
                    {
                        NumberOfTapsRequired = 2
                    };
                    tapGestureRecognizer.Tapped += (s, e) =>
                    {
                        Rects.Clear();
                        RectsStack.Clear();
                        ExtractRect = true;
                        ExtractCompleteRect(view);

                        foreach (var item in RectsStack)
                        {
                            Rects.AppendLine(item.ToString());
                        }

                        UserDialogs.Instance.Toast($"{Rects.ToString()}", TimeSpan.FromSeconds(10));
                    };
                    view.GestureRecognizers.Add(tapGestureRecognizer);
                }
            }
        }