Ejemplo n.º 1
0
        public void FullView()
        {
            Rect r = Rect.Empty;

            for (int i = 0; i < Items.Count; i++)
            {
                LayerControl lc   = GetLayerControl(i);
                Rect         rect = lc.GetRect();
                r.Union(rect);
            }
            if (r.IsEmpty)
            {
                return;
            }

            for (int i = 0; i < Items.Count; i++)
            {
                LayerControl lc = GetLayerControl(i);
                ViewUtil.ZoomtoExtent(lc.Root, r);
                //AdornerDecorator转换
                AdornerDecorator ad = GetLayerControlAdornerDecorator(i);
                Matrix           m  = Matrix.Identity;
                ad.RenderTransform = new MatrixTransform(m);
            }
        }
Ejemplo n.º 2
0
        public LayerControl GetLayerControl(int index)
        {
            var          item = ItemContainerGenerator.ContainerFromIndex(index);
            LayerControl lc   = FindChild.FindVisualChild <LayerControl>(item, "layercontrol");

            return(lc);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// LayerControl外层的AdornerDecorator
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public AdornerDecorator GetLayerControlAdornerDecorator(int index)
        {
            var              item = ItemContainerGenerator.ContainerFromIndex(index);
            LayerControl     lc   = FindChild.FindVisualChild <LayerControl>(item, "layercontrol");
            AdornerDecorator ad   = VisualTreeHelper.GetParent(lc) as AdornerDecorator;

            return(ad);
        }