Ejemplo n.º 1
0
        protected void AttachToItemsPanel()
        {
            currentItemsPanel             = (Panel)ItemsPanel.LoadContent();
            currentItemsPanel.IsItemsHost = false;

            var notifyingChildren = currentItemsPanel.Children as INotifyCollectionChanged;

            if (notifyingChildren != null)
            {
                notifyingChildren.CollectionChanged += OnItemsCollectionChanged;
            }

            if (currentItemsPanel is ViewportHostPanel)
            {
                var viewportItemsPanel = (ViewportHostPanel)currentItemsPanel;
                viewportItemsPanel.IsMarkersHost         = true;
                viewportItemsPanel.ContentBoundsChanged += viewportItemsPanel_ContentBoundsChanged;

                this.Content = viewportItemsPanel.HostingCanvas;

                if (plotter != null)
                {
                    viewportItemsPanel.OnPlotterAttached(plotter);
                }
            }

            else
            {
                this.Content = currentItemsPanel;
            }
        }
        protected void AttachToItemsPanel()
        {
            currentItemsPanel             = (Panel)ItemsPanel.LoadContent();
            currentItemsPanel.IsItemsHost = false;

            if (currentItemsPanel is ViewportHostPanel)
            {
                var viewportItemsPanel = (ViewportHostPanel)currentItemsPanel;
                viewportItemsPanel.IsMarkersHost         = true;
                viewportItemsPanel.ContentBoundsChanged += viewportItemsPanel_ContentBoundsChanged;

                if (currentItemsPanel == null)
                {
                    throw new ArgumentNullException("ItemsPanel");
                }

                Content = viewportItemsPanel.HostingCanvas;

                if (plotter != null)
                {
                    viewportItemsPanel.OnPlotterAttached(plotter);
                }
            }

            else
            {
                Content = currentItemsPanel;
            }
        }