Beispiel #1
0
        public void SelectAll()
        {
            List <DesignerItem> result = new List <DesignerItem>();

            foreach (Zone dc in ItemsSource)
            {
                DesignerItem test = ItemContainerGenerator.ContainerFromItem(dc) as DesignerItem;
                if (!test.IsSelected)
                {
                    test.IsSelected = true;
                }
            }
        }
Beispiel #2
0
        private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = DataContext as DesignerItem;

            if (this.designerItem != null)
            {
                this.designerCanvas = VisualHelper.FindAnchestor <DrawingLayer>(this.designerItem) as DrawingLayer;

                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.designerCanvas);
                if (adornerLayer != null)
                {
                    this.adorner = new SizeAdorner(this.designerItem);
                    adornerLayer.Add(this.adorner);
                }
            }
        }
Beispiel #3
0
        void _DrawingLayout_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (_DrawingLayer.IsMouseCaptured)
            {
                _DrawingLayer.ReleaseMouseCapture();

                if (_newDesignerItem != null)
                {
                    Point last = e.GetPosition(_DrawingLayer);
                    _newDesignerItem.Width  = Math.Abs(_startPos.X - last.X);
                    _newDesignerItem.Height = Math.Abs(_startPos.Y - last.Y);

                    IList ic = ItemsSource as IList;

                    if (_newDesignerItem.Width < 10 && _newDesignerItem.Height < 10)
                    {
                        ic.Remove(_newDesignerItem.DataContext);
                    }

                    _newDesignerItem = null;
                }
                e.Handled = true;
            }
        }