Represents the available event data, when the FormsPopup.Popup.Tapped event is invoked.
Inheritance: System.EventArgs
Ejemplo n.º 1
0
        private void OnPopupInitializing(object sender, EventArgs e)
        {
            Func <GestureRecognizer> factory = delegate
            {
                var closeOnTap = new TapGestureRecognizer();

                var cmd = new Command(obj =>
                {
                    var view = obj as View;

                    if (view == null)
                    {
                        return;
                    }

                    var evt = PopupTappedEventArgs.Create(this, view);

                    OnPropertyTapped(evt);
                });

                closeOnTap.Command = cmd;
                return(closeOnTap);
            };

            TapGestureRecognizerVisitor.Visit(_popupView, factory);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Instantiate a new <see cref="PopupTappedEventArgs"/>
        /// </summary>
        /// <param name="popup">The popup that was tapped</param>
        /// <param name="view">The view that was tapped</param>
        /// <returns></returns>
        public static PopupTappedEventArgs Create(Popup popup, View view)
        {
            PopupSectionType housingSectionType;

            var parentView = view.FindParent(ve =>
            {
                var parentSectionType = ve.GetValue(Popup.SectionTypeProperty);
                var currentSection = (PopupSectionType)parentSectionType;

                return currentSection == PopupSectionType.Body
                       || currentSection == PopupSectionType.Footer
                       || currentSection == PopupSectionType.Header;
            });

            if (parentView == null)
            {
                housingSectionType = PopupSectionType.Backdrop;
            }
            else
            {
                housingSectionType = (PopupSectionType)parentView.GetValue(Popup.SectionTypeProperty);
            }

            var controlType = (PopupSectionType)view.GetValue(Popup.SectionTypeProperty);
            var evt = new PopupTappedEventArgs
            {
                Popup = popup,
                ControlTapped = view,
                IsUserControl = controlType == PopupSectionType.NotSet,
                Section = housingSectionType
            };

            return evt;
        }
Ejemplo n.º 3
0
        protected virtual void OnPropertyTapped(PopupTappedEventArgs e)
        {
            var handler = Tapped;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Instantiate a new <see cref="PopupTappedEventArgs"/>
        /// </summary>
        /// <param name="popup">The popup that was tapped</param>
        /// <param name="view">The view that was tapped</param>
        /// <returns></returns>
        public static PopupTappedEventArgs Create(Popup popup, View view)
        {
            PopupSectionType housingSectionType;

            var parentView = view.FindParent(ve =>
            {
                var parentSectionType = ve.GetValue(Popup.SectionTypeProperty);
                var currentSection    = (PopupSectionType)parentSectionType;

                return(currentSection == PopupSectionType.Body ||
                       currentSection == PopupSectionType.Footer ||
                       currentSection == PopupSectionType.Header);
            });


            if (parentView == null)
            {
                housingSectionType = PopupSectionType.Backdrop;
            }
            else
            {
                housingSectionType = (PopupSectionType)parentView.GetValue(Popup.SectionTypeProperty);
            }


            var controlType = (PopupSectionType)view.GetValue(Popup.SectionTypeProperty);
            var evt         = new PopupTappedEventArgs
            {
                Popup         = popup,
                ControlTapped = view,
                IsUserControl = controlType == PopupSectionType.NotSet,
                Section       = housingSectionType
            };

            return(evt);
        }
Ejemplo n.º 5
0
 protected virtual void OnPropertyTapped(PopupTappedEventArgs e)
 {
     Tapped?.Invoke(this, e);
 }
Ejemplo n.º 6
0
		protected virtual void OnPropertyTapped(PopupTappedEventArgs e)
		{
            Tapped?.Invoke(this, e);
        }