/// <summary>
        /// Dragging has started, see if VM is IDiagramLinkViewModel and notify of moving start.
        /// </summary>
        void DragThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            diagramDesigner = DiagramHelper.GetDiagramDesigner(this);
            diagramDesignerVM = diagramDesigner.DataContext as IDiagramViewModel;

            selectedItem = null;
            selectedItemVM = null;

            edgePointVM = this.DataContext as IEdgePointViewModel;

            List<ISelectable> selection = diagramDesigner.SelectionService.CurrentSelection;
            if (selection.Count == 1)
            {
                foreach (ISelectable item in selection)
                {
                    if (item is DiagramDesignerItem)
                        if ((item as DiagramDesignerItem).IsDiagramLink)
                        {
                            selectedItem = item as DiagramDesignerItem;
                        }
                }

                // create control to display on the drag adorner
                dragCanvas = new Canvas();
                IDiagramLinkViewModel designerItem = selectedItem.DataContext as IDiagramLinkViewModel;
                selectedItemVM = designerItem;

                AddLinkAnchorAndShape(new PointD(designerItem.StartEdgePoint.X, designerItem.StartEdgePoint.Y),
                    new PointD(designerItem.EndEdgePoint.X, designerItem.EndEdgePoint.Y));

                // create drag adorner 
                if (diagramDesigner != null && selectedItemVM != null && selectedItem != null && edgePointVM != null)
                {
                    AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(diagramDesigner);
                    if (adornerLayer != null)
                    {
                        this.dragAdorner = new DragAdorner(diagramDesigner, dragCanvas, false, 1.0);
                        if (this.dragAdorner != null)
                        {
                            adornerLayer.Add(this.dragAdorner);
                            e.Handled = true;
                        }
                    }
                }
            }
            e.Handled = false;
        }
        /// <summary>
        /// Start the drag operation.
        /// </summary>
        private void Start()
        {
            if (direction == null)
            {
                if (base.VerticalAlignment == System.Windows.VerticalAlignment.Top)
                {
                    if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Left)
                        direction = DiagramItemsResizeDirection.LeftTop;
                    else if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Stretch)
                        direction = DiagramItemsResizeDirection.Top;
                    else
                        direction = DiagramItemsResizeDirection.RightTop;
                }
                else if (base.VerticalAlignment == System.Windows.VerticalAlignment.Bottom)
                {
                    if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Left)
                        direction = DiagramItemsResizeDirection.LeftBottom;
                    else if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Stretch)
                        direction = DiagramItemsResizeDirection.Bottom;
                    else
                        direction = DiagramItemsResizeDirection.RightBottom;
                }
                else
                {
                    if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Left)
                        direction = DiagramItemsResizeDirection.Left;
                    else
                        direction = DiagramItemsResizeDirection.Right;
                }

            }
            diagramDesigner = DiagramHelper.GetDiagramDesigner(this);
            diagramDesignerVM = diagramDesigner.DataContext as IDiagramViewModel;

            selectedItems = new List<DiagramDesignerItem>();
            selectedItemsVM = new List<IDiagramItemViewModel>();

            List<ISelectable> selection = diagramDesigner.SelectionService.CurrentSelection;
            foreach (ISelectable item in selection)
            {
                if (item is DiagramDesignerItem)
                    if (!(item as DiagramDesignerItem).IsDiagramLink)
                    {
                        selectedItems.Add(item as DiagramDesignerItem);
                    }
            }

            // create control to display on the drag adorner
            dragCanvas = new Canvas();
            foreach (DiagramDesignerItem item in selectedItems)
            {
                if (item.DataContext is IDiagramItemViewModel)
                    selectedItemsVM.Add(item.DataContext as IDiagramItemViewModel);

                Rectangle r = new Rectangle();
                r.Stroke = new SolidColorBrush(Colors.Black);
                r.StrokeDashArray = new DoubleCollection();
                r.StrokeDashArray.Add(3);
                r.StrokeDashArray.Add(6);
                r.StrokeThickness = 1.0;
                r.Width = item.ActualWidth;
                r.Height = item.ActualHeight;
                r.Margin = new System.Windows.Thickness(item.AbsoluteLocation.X, item.AbsoluteLocation.Y, 0, 0);
                dragCanvas.Children.Add(r);
            }

            // create drag adorner 
            if (diagramDesigner != null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(diagramDesigner);
                if (adornerLayer != null)
                {
                    this.dragAdorner = new DragAdorner(diagramDesigner, dragCanvas, false, 1.0);
                    if (this.dragAdorner != null)
                    {
                        adornerLayer.Add(this.dragAdorner);
                        //e.Handled = true;
                    }
                }
            }
            //e.Handled = false;
        }
        /// <summary>
        /// Start the drag operation.
        /// </summary>
        private void Start()
        {
            if (direction == null)
            {
                if (base.VerticalAlignment == System.Windows.VerticalAlignment.Top)
                {
                    if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Left)
                    {
                        direction = DiagramItemsResizeDirection.LeftTop;
                    }
                    else if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Stretch)
                    {
                        direction = DiagramItemsResizeDirection.Top;
                    }
                    else
                    {
                        direction = DiagramItemsResizeDirection.RightTop;
                    }
                }
                else if (base.VerticalAlignment == System.Windows.VerticalAlignment.Bottom)
                {
                    if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Left)
                    {
                        direction = DiagramItemsResizeDirection.LeftBottom;
                    }
                    else if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Stretch)
                    {
                        direction = DiagramItemsResizeDirection.Bottom;
                    }
                    else
                    {
                        direction = DiagramItemsResizeDirection.RightBottom;
                    }
                }
                else
                {
                    if (base.HorizontalAlignment == System.Windows.HorizontalAlignment.Left)
                    {
                        direction = DiagramItemsResizeDirection.Left;
                    }
                    else
                    {
                        direction = DiagramItemsResizeDirection.Right;
                    }
                }
            }
            diagramDesigner   = DiagramHelper.GetDiagramDesigner(this);
            diagramDesignerVM = diagramDesigner.DataContext as IDiagramViewModel;

            selectedItems   = new List <DiagramDesignerItem>();
            selectedItemsVM = new List <IDiagramItemViewModel>();

            List <ISelectable> selection = diagramDesigner.SelectionService.CurrentSelection;

            foreach (ISelectable item in selection)
            {
                if (item is DiagramDesignerItem)
                {
                    if (!(item as DiagramDesignerItem).IsDiagramLink)
                    {
                        selectedItems.Add(item as DiagramDesignerItem);
                    }
                }
            }

            // create control to display on the drag adorner
            dragCanvas = new Canvas();
            foreach (DiagramDesignerItem item in selectedItems)
            {
                if (item.DataContext is IDiagramItemViewModel)
                {
                    selectedItemsVM.Add(item.DataContext as IDiagramItemViewModel);
                }

                Rectangle r = new Rectangle();
                r.Stroke          = new SolidColorBrush(Colors.Black);
                r.StrokeDashArray = new DoubleCollection();
                r.StrokeDashArray.Add(3);
                r.StrokeDashArray.Add(6);
                r.StrokeThickness = 1.0;
                r.Width           = item.ActualWidth;
                r.Height          = item.ActualHeight;
                r.Margin          = new System.Windows.Thickness(item.AbsoluteLocation.X, item.AbsoluteLocation.Y, 0, 0);
                dragCanvas.Children.Add(r);
            }

            // create drag adorner
            if (diagramDesigner != null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(diagramDesigner);
                if (adornerLayer != null)
                {
                    this.dragAdorner = new DragAdorner(diagramDesigner, dragCanvas, false, 1.0);
                    if (this.dragAdorner != null)
                    {
                        adornerLayer.Add(this.dragAdorner);
                        //e.Handled = true;
                    }
                }
            }
            //e.Handled = false;
        }
        /// <summary>
        /// Start the drag operation.
        /// </summary>
        private void Start()
        {
            diagramDesigner   = DiagramHelper.GetDiagramDesigner(this);
            diagramDesignerVM = diagramDesigner.DataContext as IDiagramViewModel;

            selectedItems   = new List <DiagramDesignerItem>();
            selectedItemsVM = new List <IDiagramItemViewModel>();

            List <ISelectable> selection = diagramDesigner.SelectionService.CurrentSelection;

            foreach (ISelectable item in selection)
            {
                if (item is DiagramDesignerItem)
                {
                    if (!(item as DiagramDesignerItem).IsDiagramLink)
                    {
                        selectedItems.Add(item as DiagramDesignerItem);
                    }
                }
            }

            // create control to display on the drag adorner
            Canvas canvas = new Canvas();

            foreach (DiagramDesignerItem item in selectedItems)
            {
                IDiagramItemViewModel designerItem = item.DataContext as IDiagramItemViewModel;
                if (designerItem == null)
                {
                    continue;
                }

                selectedItemsVM.Add(designerItem);

                Rectangle r = new Rectangle();
                r.Stroke          = new SolidColorBrush(Colors.Black);
                r.StrokeDashArray = new DoubleCollection();
                r.StrokeDashArray.Add(3);
                r.StrokeDashArray.Add(6);
                r.StrokeThickness = 1.0;
                r.Width           = item.ActualWidth;
                r.Height          = item.ActualHeight;
                r.Margin          = new System.Windows.Thickness(designerItem.AbsoluteLocation.X, designerItem.AbsoluteLocation.Y, 0, 0);
                canvas.Children.Add(r);
            }

            // create drag adorner
            if (diagramDesigner != null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(diagramDesigner);
                if (adornerLayer != null)
                {
                    this.dragAdorner = new DragAdorner(diagramDesigner, canvas, false, 1.0);
                    if (this.dragAdorner != null)
                    {
                        adornerLayer.Add(this.dragAdorner);
                        //e.Handled = true;
                    }
                }
            }
            //e.Handled = false;
        }
        /// <summary>
        /// Start the drag operation.
        /// </summary>
        private void Start()
        {
            diagramDesigner = DiagramHelper.GetDiagramDesigner(this);
            diagramDesignerVM = diagramDesigner.DataContext as IDiagramViewModel;
            
            selectedItems = new List<DiagramDesignerItem>();
            selectedItemsVM = new List<IDiagramItemViewModel>();

            List<ISelectable> selection = diagramDesigner.SelectionService.CurrentSelection;
            foreach (ISelectable item in selection)
            {
                if (item is DiagramDesignerItem)
                    if (!(item as DiagramDesignerItem).IsDiagramLink)
                    {
                        selectedItems.Add(item as DiagramDesignerItem);
                    }
            }

            // create control to display on the drag adorner
            Canvas canvas = new Canvas();
            foreach (DiagramDesignerItem item in selectedItems)
            {
                IDiagramItemViewModel designerItem = item.DataContext as IDiagramItemViewModel;
                if (designerItem == null)
                    continue;

                selectedItemsVM.Add(designerItem);                    

                Rectangle r = new Rectangle();
                r.Stroke = new SolidColorBrush(Colors.Black);
                r.StrokeDashArray = new DoubleCollection();
                r.StrokeDashArray.Add(3);
                r.StrokeDashArray.Add(6);
                r.StrokeThickness = 1.0;
                r.Width = item.ActualWidth;
                r.Height = item.ActualHeight;
                r.Margin = new System.Windows.Thickness(designerItem.AbsoluteLocation.X, designerItem.AbsoluteLocation.Y, 0, 0);
                canvas.Children.Add(r);
            }

            // create drag adorner 
            if (diagramDesigner != null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(diagramDesigner);
                if (adornerLayer != null)
                {
                    this.dragAdorner = new DragAdorner(diagramDesigner, canvas, false, 1.0);
                    if (this.dragAdorner != null)
                    {
                        adornerLayer.Add(this.dragAdorner);
                        //e.Handled = true;
                    }
                }
            }
            //e.Handled = false;
        }