private void AddToSelection(Element element) { if (_selectedElements.Contains(element)) return; //if (element is CompositeElement) // label1.Content = (element as CompositeElement).GroupName; //DropShadowEffect glowEffect = new DropShadowEffect() //{ // ShadowDepth = 0, // Color = Colors.GreenYellow, // Opacity = 1, // BlurRadius = 20 //}; //element.Effect = glowEffect; element.Effect = Tools.EffectsHelper.CreateGlowEffect(Colors.GreenYellow); _selectedElements.Add(element as Element); }
private void RefreshScalingLine(Window wnd, Element element, Canvas canvas) { Vector offset = new Vector(wnd.Width / 2, 0);//ScalingWindow.Height + 125); Point translatedPoint = wnd.TranslatePoint(new Point(0, 0) + offset, canvas); canvas.Children.Remove(ScalingLine); ScalingLine = new Line(); ScalingLine.X1 = translatedPoint.X; ScalingLine.Y1 = translatedPoint.Y; ScalingLine.X2 = element.Position.X + element.Width / 2; ScalingLine.Y2 = element.Position.Y + element.Height / 8; SolidColorBrush redBrush = new SolidColorBrush(); redBrush.Color = Colors.DarkGreen; ScalingLine.StrokeThickness = 3; ScalingLine.Stroke = redBrush; //проверка, находится ли это окно в области канваса if (new Rect(canvas.RenderSize).Contains(new Point(ScalingLine.X1, ScalingLine.Y1))) canvas.Children.Add(ScalingLine); }
private void RemoveFromSelection(Element element) { element.Effect = null; _selectedElements.Remove(element); }