RightToLeft

Wisej.NET supports Right-to-Left and Right-to-Left-Layout (mirroring) quite extensively in most controls, in the themes, in the Theme Builder, and in the designer.

The following controls do not fully support RightToLeft at the moment: DataGridView, ListView, PropertyGrid.

RightToLeft Property

The RightToLeft property makes a control adapt its internal layout and alignment for right-to-left languages. The default value is Inherit, which works in most cases. However, an application can:

  • Force a control to ignore right-to-left mode by setting the value to No

  • Force right-to-left mode by setting the value to Yes

This property is localizable.

RightToLeftLayout Property

The RightToLeftLayout property mirrors the horizontal position of a container's direct children. The default value is false.

When set to true, horizontal layout is mirrored only when RightToLeft resolves to Yes.

Set this property to:

  • false to prevent Wisej.NET from mirroring layout in right-to-left mode

  • true to mirror horizontal location of direct children in right-to-left mode

This property is localizable.

Application.RightToLeft Property

Application.RightToLeft takes its value from:

  • The "rightToLeft" Configuration setting

  • Can be forced to true or false programmatically

The default value of Control.RightToLeft is Inherit, meaning a control inherits the value from its parent. Top-level containers and parentless controls with RightToLeft set to Inherit take their value from Application.RightToLeft.

Themes

All Wisej.NET themes support RightToLeft mode with minimal required changes. When a widget operates in right-to-left mode, it has the "rightToLeft" state allowing theme adaptation.

Most cases need no changes. Typical right-to-left adjustments include:

  • Mirroring icons

  • Switching single side border location

Example of mirroring icons with a state style:

"rightToLeft":
{
  "styles":
  {
    "transform": "scale(-1, 1)"
  }
},

TreeView arrows requiring 45-degree rotation when expanded and mirroring can adapt using these states:

"rightToLeft":
{
  "styles":
  {
    "transform": "rotateZ(180deg)"
  }
},
"opened-rightToLeft":
{
  "styles":
  {
    "transform": "rotateZ(135deg)"
  }
},

The composite state "opened-rightToLeft" qualifies styles and properties only when the widget has both states set simultaneously.

Last updated