From 85547a2446b00c8ac9aafb37a34837375ed67747 Mon Sep 17 00:00:00 2001 From: DianeXceed <29433908+DianeXceed@users.noreply.github.com> Date: Mon, 4 Jun 2018 15:24:26 -0400 Subject: [PATCH] Updated RelativeCanvas (markdown) --- RelativeCanvas.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/RelativeCanvas.md b/RelativeCanvas.md index 08be20d..05ad34b 100644 --- a/RelativeCanvas.md +++ b/RelativeCanvas.md @@ -7,6 +7,30 @@ A Panel which is similar to Canvas but it lays out its children relative to the [[RelativeCanvas_relativecanvas.jpg]] +### Remarks + +Items in a RelativeCanvas are placed relative to the RelativeCanvas itself. The following attached properties each have their use: + +* RelativeCanvas.Left (value >= 0): used to indicate where to place the item from left to right. + * 0 = Extreme left + * 1 = Extreme right +* RelativeCanvas.Top (value >= 0): used to indicate where to place the item from top to bottom. + * 0 = Complete top + * 1 = Complete bottom +* RelativeCanvas.RelativeWidth (value >= 0): used to indicate the width of the element relative to the width of the RelativeCanvas + * ex: a value of 0.5 will indicate that the element's width must be half the width of the RelativeCanvas +* RelativeCanvas.RelativeHeight (value >= 0): used to indicate the height of the element relative to the height of the RelativeCanvas + * ex: a value of 0.5 will indicate that the element's height must be half the height of the RelativeCanvas +* RelativeCanvas.PinPoint: reference point from which the other properties/characteristics will be calculated. + * (0,0) = Top left corner + * (1,0) = Top right corner + * (0,1) = Bottom left corner + * (1,1) = Bottom right corner + +This means that the attached properties RelativeCanvas.RelativeWidth and RelativeCanvas.RelativeHeight must be set on the elements that should have a size relative to the size of the RelativeCanvas. + +For elements that should have a fixed size, assign a value to FrameworkElement.Width and/or FrameworkElement.Height. For elements that should have a size in function of their content, do not specify anything. + ### Properties | Property | Description | | --- | --- |