Example #1
0
        partial void OnPopupPanelChangedPartial(PopupPanel previousPanel, PopupPanel newPanel)
        {
            if (previousPanel?.Superview != null)
            {
                // Remove the current child, if any.
                previousPanel.Children.Clear();

                previousPanel.RemoveFromSuperview();
            }

            if (newPanel != null)
            {
                if (Child != null)
                {
                    // Make sure that the child does not find itself without a TemplatedParent
                    if (newPanel.TemplatedParent == null)
                    {
                        newPanel.TemplatedParent = TemplatedParent;
                    }

                    newPanel.AddSubview(Child);
                }

                newPanel.Background = GetPanelBackground();

                RegisterPopupPanel();
            }
        }
Example #2
0
        partial void OnChildChangedPartialNative(UIElement oldChild, UIElement newChild)
        {
            if (PopupPanel != null)
            {
                if (oldChild != null)
                {
                    PopupPanel.RemoveChild(oldChild);
                }

                if (newChild != null)
                {
                    PopupPanel.AddSubview(newChild);
                }
            }
        }