Ejemplo n.º 1
0
        /// <summary>
        ///    Shows the popup with constraints.
        /// </summary>
        /// <param name="popupView">The popup view.</param>
        /// <param name="xConstraint">X constraint.</param>
        /// <param name="yConstraint">Y constraint.</param>
        /// <param name="widthConstraint">Optional width constraint.</param>
        /// <param name="heightConstraint">Optional height constraint.</param>
        public void ShowPopup(View popupView, Constraint xConstraint, Constraint yConstraint, Constraint widthConstraint = null, Constraint heightConstraint = null)
        {
            DismissPopup();
            popup = popupView;

            layout.InputTransparent  = true;
            content.InputTransparent = true;
            content.Opacity          = 0.5;

            layout.Children.Add(popup, xConstraint, yConstraint, widthConstraint, heightConstraint);
            AllowAction.Dispatch(false);

            layout.ForceLayout();
        }
Ejemplo n.º 2
0
        /// <summary>
        ///    Dismisses the popup.
        /// </summary>
        public void DismissPopup()
        {
            if (popup != null)
            {
                layout.Children.Remove(popup);
                popup = null;
            }

            layout.InputTransparent = false;

            if (content != null)
            {
                content.InputTransparent = false;
                content.Opacity          = 1;
            }
            AllowAction.Dispatch(true);
        }