Beispiel #1
0
        public override void Draw(DrawingContext context, Matrix matrix)
        {
            if (this.Icon == null)
            {
                return;
            }
            if (!this.IsActive)
            {
                context.PushOpacity(0.5);
            }
            CanonicalTransform canonicalTransform = new CanonicalTransform((Transform) new MatrixTransform(matrix));
            ScaleTransform     scaleTransform     = new ScaleTransform(canonicalTransform.ScaleX, canonicalTransform.ScaleY);

            canonicalTransform.Scale = new Vector(1.0, 1.0);
            Transform transform = DockAdorner.RemoveScaleFromCanonicalTransform(canonicalTransform);

            context.PushTransform(transform);
            Point adornerPosition = this.GetAdornerPosition(scaleTransform);

            context.PushTransform((Transform) new TranslateTransform(adornerPosition.X, adornerPosition.Y));
            context.DrawDrawing(this.Icon);
            context.Pop();
            context.Pop();
            if (this.IsActive)
            {
                return;
            }
            context.Pop();
        }
Beispiel #2
0
 public DockAdorner(AdornerSet adornerSet, Dock dock)
     : base(adornerSet)
 {
     this.dock    = dock;
     this.drawing = DockAdorner.GetAdornerDrawing(this.Dock);
 }