protected override void OnPaint(ActivityDesignerPaintEventArgs e) { base.OnPaint(e); CompositeDesignerTheme compositeDesignerTheme = e.DesignerTheme as CompositeDesignerTheme; if (compositeDesignerTheme == null) { return; } //Draw the watermark at right bottom Rectangle watermarkRectangle = Rectangle.Empty; if (compositeDesignerTheme.WatermarkImage != null) { Rectangle bounds = Bounds; bounds.Inflate(-e.AmbientTheme.Margin.Width, -e.AmbientTheme.Margin.Height); watermarkRectangle = ActivityDesignerPaint.GetRectangleFromAlignment(compositeDesignerTheme.WatermarkAlignment, bounds, compositeDesignerTheme.WatermarkImage.Size); } //Here we go, draw header and footer rectangles if (Header != null) { Header.OnPaint(e); } if (Footer != null) { Footer.OnPaint(e); } }
private Rectangle GetActionBounds(int actionIndex) { Rectangle destination = new Rectangle(Point.Empty, base.ParentView.ViewPortSize); DynamicAction action = this.actions[actionIndex]; destination.Inflate(-action.DockMargin.Width, -action.DockMargin.Height); return(new Rectangle(ActivityDesignerPaint.GetRectangleFromAlignment(action.DockAlignment, destination, action.Bounds.Size).Location, action.Bounds.Size)); }
protected override void OnPaint(ActivityDesignerPaintEventArgs e) { base.OnPaint(e); CompositeDesignerTheme designerTheme = e.DesignerTheme as CompositeDesignerTheme; if (designerTheme != null) { if (designerTheme.WatermarkImage != null) { Rectangle bounds = base.Bounds; bounds.Inflate(-e.AmbientTheme.Margin.Width, -e.AmbientTheme.Margin.Height); ActivityDesignerPaint.GetRectangleFromAlignment(designerTheme.WatermarkAlignment, bounds, designerTheme.WatermarkImage.Size); } if (this.Header != null) { this.Header.OnPaint(e); } if (this.Footer != null) { this.Footer.OnPaint(e); } } }