Description
The Static
field of the PositionMode
enumeration represents the default positioning mode for UI elements. In this mode, the top
, right
, bottom
, left
, and z-index
properties have no effect on the element's position. This is equivalent to the default behavior of elements in standard HTML/CSS where they are positioned according to the normal flow of the document.
Usage
Use PositionMode.Static
when you want an element to follow the normal document flow without any additional positioning adjustments. This is useful for elements that should be positioned naturally within the layout without any offsets or stacking order changes.
Example
// Example of using PositionMode.Static in a UI component
public class MyUIComponent : Panel
{
public MyUIComponent()
{
// Set the position mode to Static
this.Style.Position = PositionMode.Static;
// Add other styling or elements
this.Style.Width = Length.Percent(100);
this.Style.Height = Length.Pixels(50);
this.Style.BackgroundColor = Color.Gray;
}
}