public virtual Utilities.Box GetDimensionBox() { var box = new Utilities.Box { X = Canvas.GetLeft( this ), Y = Canvas.GetTop( this ), Width = this.ActualWidth, Height = this.ActualHeight }; return box; }
/** * Get the dimension box of the container (also considers its children). */ public override Utilities.Box GetDimensionBox() { var box = new Utilities.Box { X = Canvas.GetLeft( this ), Y = Canvas.GetTop( this ), Width = this.ActualWidth, Height = this.ActualHeight }; var lastCard = this.GetLast(); // the last card may be outside the container dimensions, so need to consider that if ( lastCard != null ) { var point = lastCard.TranslatePoint( new Point( 0, 0 ), this ); var combinedHeight = point.Y + lastCard.ActualHeight; if ( combinedHeight > box.Height ) { box.Height = combinedHeight; } } return box; }