示例#1
0
        protected PopupTip GetPopupTipWindow()
        {
            if (popup != null)
            {
                return(popup);
            }

            foreach (var item in Plotter.Children)
            {
                if (item is ViewportUIContainer)
                {
                    ViewportUIContainer container = (ViewportUIContainer)item;
                    if (container.Content is PopupTip)
                    {
                        return(popup = (PopupTip)container.Content);
                    }
                }
            }

            popup                 = new PopupTip();
            popup.Placement       = PlacementMode.Relative;
            popup.PlacementTarget = this;
            Plotter.Children.Add(popup);
            return(popup);
        }
示例#2
0
        public void Add(FrameworkElement content)
        {
            if (content == null)
            {
                throw new ArgumentNullException("content");
            }

            IPlotterElement plotterElement = content as IPlotterElement;

            if (plotterElement != null)
            {
                Add(plotterElement);
            }
            else
            {
                ViewportUIContainer container = new ViewportUIContainer(content);
                Add(container);
            }
        }