Skip to content

RelativeCanvas

DianeXceed edited this page Jun 4, 2018 · 3 revisions

RelativeCanvas

Only available in the Plus Edition

Derives from AnimationPanel

A Panel which is similar to Canvas but it lays out its children relative to the panel's height and width.

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
* All the Properties from Canvas Panel.
Left (attached) Gets or sets the Left property.
PinPoint (attached) Gets or sets the PinPoint property.
RelativeHeight (attached) Gets or sets the RelativeHeight property.
RelativeWidth (attached) Gets or sets the RelativeWidth property.
Top (attached) Gets or sets the Top property.

Events

Event Description
* All the Events from Canvas Panel.
Clone this wiki locally