예제 #1
0
        public void RemoveBox(PopupBox box)
        {
            var container = (Application.Current.RootVisual as UserControl).FindName("LayoutRoot") as Panel;

            if (this.LayOutRoot == container)
            {
                RootVisualContainerCount--;
                if (RootVisualContainerCount == 0 && OldMessageBoxParent != null && MessageBoxPanel != null)
                {
                    if (container.Children.Contains(MessageBoxPanel))
                    {
                        container.Children.Remove(MessageBoxPanel);
                        OldMessageBoxParent.Children.Add(MessageBoxPanel);
                        MessageBoxPanel.Visibility = Visibility.Collapsed;
                    }
                }
            }

            MaskPanel.Children.Remove(box);

            CheckModal();

            if (MaskPanel.Children.Count == 0)
            {
                LayOutRoot.Children.Remove(MaskPanel);
                box.LayoutMask = null;
            }

            if (PopupBox.PopupBoxes.Count > 0)
            {
                PopupBox.PopupBoxes.Pop();
            }
        }
예제 #2
0
        public IDialog ShowDialog(string title, string url, ResultHandler callback, Size size, Panel container, IPageBrowser pageBrowser)
        {
            if (m_browser == null)
            {
                m_browser = pageBrowser;
            }

            if (this.Current == null)
            {
                if (container == null)
                {
                    container = m_browser.SelectedContent as Panel;
                }

                PopupBox box = new PopupBox(container, this);
                box.Closed = this.Closed;
                box.ShowDialog(title, url, callback, size, container, pageBrowser);
                return(box);
            }
            else
            {
                this.ShowDialog(title, url, true, size, callback);
                return(this);
            }
        }
예제 #3
0
 public IDialog ShowDialog(string title, FrameworkElement content, ResultHandler callback, Size size, Panel container)
 {
     if (this.Current == null)
     {
         if (container == null)
         {
             container = m_browser.SelectedContent as Panel;
         }
         PopupBox box = new PopupBox(container, this);
         box.Closed = this.Closed;
         box.ShowDialog(title, content, callback, size, container);
         return(box);
     }
     else
     {
         this.ShowDialog(content, title, true, size, callback);
         return(this);
     }
 }
예제 #4
0
        public void AddBox(PopupBox box)
        {
            var container = (Application.Current.RootVisual as UserControl).FindName("LayoutRoot") as Panel;

            if (this.LayOutRoot == container)
            {
                RootVisualContainerCount++;
            }

            if (!MaskPanel.Children.Contains(box))
            {
                MaskPanel.Children.Add(box);
            }

            CheckModal();

            if (IsRendered == false)
            {
                RenderMask();
            }

            PopupBox.PopupBoxes.Push(box);
        }
예제 #5
0
        public void Alert(string title, string content, MessageType messageType, ResultHandler handler, Panel container)
        {
            if (this.Current == null)
            {
                if (container == null)
                {
                    container = m_browser.SelectedContent as Panel;
                }

                PopupBox box = new PopupBox(container, this);
                box.ResultHandler += handler;
                box.Alert(title, content, messageType, handler, container);
            }
            else
            {
                if (UtilityHelper.IsNullOrEmpty(title))
                {
                    title = MessageResource.ResourceManager.GetString(string.Format("PopupBox_Title_{0}", Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information.ToString()));
                }

                Show(content, title, PopType.Alert, messageType);
            }
        }
예제 #6
0
 public PopupBox(Panel layoutRoot, PopupBox parent)
     : this(layoutRoot)
 {
     m_popupBox = parent;
 }