private void rectangle_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Right)
            {
                //右クリックされた時は、領域お絵かきではなくスクロール
                return;
            }
            if (e.ClickCount == 2)
            {
                Delete();
                return;
            }

            inDrag = true;

            var obj = ((AreaSettingCanvesViewModel)this.DataContext);

            nowMovingObj = new Rectangle();


            foreach (var oldRectEx in obj.GivenPictureData.CalcAreas)
            {
                if (oldRectEx.X <= obj.MouseX &&
                    oldRectEx.Y <= obj.MouseY &&
                    obj.MouseX < oldRectEx.X + oldRectEx.Width &&
                    obj.MouseY < oldRectEx.Y + oldRectEx.Height)
                {
                    oldRectX     = oldRectEx.X;
                    oldRectY     = oldRectEx.Y;
                    nowActiveObj = oldRectEx;
                }
            }


            Canvas.SetTop(nowMovingObj, oldRectY);
            Canvas.SetLeft(nowMovingObj, oldRectX);
            nowMovingObj.Width  = ((Rectangle)sender).Width;
            nowMovingObj.Height = ((Rectangle)sender).Height;

            ((Rectangle)sender).Opacity = 0;

            this.mainCanves.Children.Add(nowMovingObj);

            diffX = obj.MouseX - oldRectX;
            diffY = obj.MouseY - oldRectY;
            ((Rectangle)sender).CaptureMouse();
        }
        private void Delete()
        {
            Yanoshi.CalcHLACGUI.Models.RectEx deleteObj = null;
            var obj = ((AreaSettingCanvesViewModel)this.DataContext);

            foreach (var oldRectEx in obj.GivenPictureData.CalcAreas)
            {
                if (oldRectEx.X <= obj.MouseX &&
                    oldRectEx.Y <= obj.MouseY &&
                    obj.MouseX < oldRectEx.X + oldRectEx.Width &&
                    obj.MouseY < oldRectEx.Y + oldRectEx.Height)
                {
                    deleteObj = oldRectEx;
                }
            }
            if (deleteObj != null)
            {
                obj.GivenPictureData.CalcAreas.Remove(deleteObj);
            }
        }