コード例 #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();
            }
        }
コード例 #2
0
        partial void InitializePartial()
        {
#if __ANDROID__
            if (_useNativePopup)
            {
                InitializeNativePartial();
            }
#endif

            PopupPanel = new PopupPanel(this);
        }
コード例 #3
0
ファイル: Popup.net.cs プロジェクト: Robert-Louis/Uno
        partial void OnPopupPanelChangedPartial(PopupPanel previousPanel, PopupPanel newPanel)
        {
            previousPanel?.Children.Clear();

            if (PopupPanel != null)
            {
                if (Child != null)
                {
                    PopupPanel.Children.Add(Child);
                }
            }
        }
コード例 #4
0
        private void RegisterPopupPanel()
        {
            if (PopupPanel == null)
            {
                PopupPanel = new PopupPanel(this);
            }

            if (PopupPanel.Superview == null)
            {
                MainWindowContent?.AddSubview(PopupPanel);
            }
        }
コード例 #5
0
        partial void OnIsOpenChangedPartialNative(bool oldIsOpen, bool newIsOpen)
        {
            RegisterPopupPanel();

            UpdateLightDismissLayer(newIsOpen);

            // this is necessary as during initial measure the panel was Collapsed
            // and got 0 available size from its parent (root Window element, usually a Frame)
            // this will ensure the size of its child will be calculated properly
            PopupPanel.OnInvalidateMeasure();

            EnsureForward();
        }
コード例 #6
0
ファイル: Popup.iOS.cs プロジェクト: Robert-Louis/Uno
        private void RegisterPopupPanel()
        {
            if (PopupPanel == null)
            {
                PopupPanel = new PopupPanel(this);
            }

            if (PopupPanel.Superview == null)
            {
                PopupPanel.IsVisualTreeRoot = true;
                MainWindow.AddSubview(PopupPanel);
            }
        }
コード例 #7
0
        partial void OnChildChangedPartialNative(UIElement oldChild, UIElement newChild)
        {
            if (PopupPanel != null)
            {
                if (oldChild != null)
                {
                    PopupPanel.RemoveChild(oldChild);
                }

                if (newChild != null)
                {
                    PopupPanel.AddSubview(newChild);
                }
            }
        }
コード例 #8
0
        partial void OnPopupPanelChangedPartialNative(PopupPanel previousPanel, PopupPanel newPanel)
        {
            previousPanel?.Children.Clear();

            if (PopupPanel != null)
            {
                if (Child != null)
                {
                    PopupPanel.Children.Add(Child);
                }
            }

            newPanel.IsVisualTreeRoot = true;
            _popupWindow.ContentView  = newPanel;

            UpdatePopupPanelDismissibleBackground(IsLightDismissEnabled);
        }
コード例 #9
0
 /// <summary>
 /// Ensure that Popup panel is forward-most in the window. This ensures it isn't hidden behind the main content, which can happen when
 /// the Popup is created during initial launch.
 /// </summary>
 private void EnsureForward()
 {
     //macOS does not have BringSubviewToFront,
     //solution based on https://stackoverflow.com/questions/4236304/os-x-version-of-bringsubviewtofront
     if (PopupPanel.Layer.SuperLayer != null)
     {
         var superlayer = PopupPanel.Layer.SuperLayer;
         PopupPanel.Layer.RemoveFromSuperLayer();
         superlayer.AddSublayer(PopupPanel.Layer);
     }
     else if (PopupPanel.Superview != null)
     {
         var superview = PopupPanel.Superview;
         PopupPanel.RemoveFromSuperview();
         superview.AddSubview(PopupPanel);
     }
 }
コード例 #10
0
        partial void OnPopupPanelChangedPartial(PopupPanel previousPanel, PopupPanel newPanel)
        {
#if __ANDROID__
            if (_useNativePopup)
            {
                OnPopupPanelChangedPartialNative(previousPanel, newPanel);
            }
            else
#endif
            {
                previousPanel?.Children.Clear();

                if (newPanel != null)
                {
                    if (Child != null)
                    {
                        newPanel.Children.Add(Child);
                    }
                    newPanel.Background = GetPanelBackground();
                }
            }
        }
コード例 #11
0
ファイル: Popup.net.cs プロジェクト: Robert-Louis/Uno
 partial void InitializePartial()
 {
     PopupPanel = new PopupPanel(this);
 }
コード例 #12
0
 partial void OnUnloadedPartial()
 {
     PopupPanel?.RemoveFromSuperview();
 }
コード例 #13
0
ファイル: Popup.iOS.cs プロジェクト: Robert-Louis/Uno
 partial void OnUnloadedPartial()
 {
     PopupPanel?.RemoveFromSuperview();
     UnregisterPopupPanelChild();
 }
コード例 #14
0
 partial void OnPopupPanelChangedPartialNative(PopupPanel previousPanel, PopupPanel newPanel);