Represents the available event data, when the FormsPopup.Popup.Tapped event is invoked.
Inheritance: System.EventArgs
コード例 #1
0
ファイル: Popup.cs プロジェクト: sorke/FormsPopup
        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);
        }
コード例 #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;
        }
コード例 #3
0
ファイル: Popup.cs プロジェクト: sorke/FormsPopup
        protected virtual void OnPropertyTapped(PopupTappedEventArgs e)
        {
            var handler = Tapped;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #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);
        }
コード例 #5
0
ファイル: Popup.cs プロジェクト: xamarinua/FormsPopup
 protected virtual void OnPropertyTapped(PopupTappedEventArgs e)
 {
     Tapped?.Invoke(this, e);
 }
コード例 #6
0
ファイル: Popup.cs プロジェクト: michaeled/FormsPopup
		protected virtual void OnPropertyTapped(PopupTappedEventArgs e)
		{
            Tapped?.Invoke(this, e);
        }