# FlexLayoutPanelExtensions

Namespace: **Wisej.Web.Markup**

Assembly: **Wisej.Framework** (4.0.0.0)

Adds [fluent markup](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/markup/markup) extension methods to the [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel) class.

{% tabs %}
{% tab title="C#" %}

```csharp
public class FlexLayoutPanelExtensions
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class FlexLayoutPanelExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) AlignX\<TPanel>(panel, control, value)

Sets the horizontal alignment for a specific control within the specified [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel).

| Parameter   | Type                                                                                                        | Description                                                                                                                        |
| ----------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel**  |                                                                                                             | The type of the panel, which must inherit from [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel). |
| **panel**   | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions) | The panel containing the control.                                                                                                  |
| **control** | [Control](https://docs.wisej.com/api/wisej.web/general/control)                                             | The control to set the horizontal alignment for.                                                                                   |
| **value**   | [HorizontalAlignment](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.horizontalalignment)      | The horizontal alignment value to set.                                                                                             |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions). The modified panel with the updated horizontal alignment for the control.

This method allows you to fluently set the horizontal alignment of a control within a panel.

```csharp

var panel = new FlexLayoutPanel();
var control = new Control();
panel.AlignX(control, HorizontalAlignment.Right);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) AlignY\<TPanel>(panel, control, value)

Sets the vertical alignment for a specific control within the specified [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel).

| Parameter   | Type                                                                                                        | Description                                                                                                                        |
| ----------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel**  |                                                                                                             | The type of the panel, which must inherit from [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel). |
| **panel**   | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions) | The panel containing the control.                                                                                                  |
| **control** | [Control](https://docs.wisej.com/api/wisej.web/general/control)                                             | The control to set the vertical alignment for.                                                                                     |
| **value**   | [VerticalAlignment](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.verticalalignment)          | The vertical alignment value to set.                                                                                               |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions). The modified panel with the updated vertical alignment for the control.

This method allows you to fluently set the vertical alignment of a control within a panel.

```csharp

var panel = new FlexLayoutPanel();
var control = new Control();
panel.AlignY(control, VerticalAlignment.Bottom);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) FillWeight\<TPanel>(panel, control, value)

Sets the fill weight for a specific control within the specified [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel).

| Parameter   | Type                                                                                                        | Description                                                                                                                        |
| ----------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel**  |                                                                                                             | The type of the panel, which must inherit from [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel). |
| **panel**   | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions) | The panel containing the control.                                                                                                  |
| **control** | [Control](https://docs.wisej.com/api/wisej.web/general/control)                                             | The control to set the fill weight for.                                                                                            |
| **value**   | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                                 | The fill weight value to set.                                                                                                      |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions). The modified panel with the updated fill weight for the control.

This method allows you to fluently set the fill weight of a control within a panel.

```csharp

var panel = new FlexLayoutPanel();
var control = new Control();
panel.FillWeight(control, 2);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) HorizontalAlign\<TPanel>(panel, value)

Sets the horizontal alignment of the specified [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel).

| Parameter  | Type                                                                                                        | Description                                                                                                                        |
| ---------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                                             | The type of the panel, which must inherit from [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel). |
| **panel**  | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions) | The panel to set the horizontal alignment for.                                                                                     |
| **value**  | [HorizontalAlignment](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.horizontalalignment)      | The horizontal alignment value to set.                                                                                             |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions). The modified panel with the updated horizontal alignment.

This method allows you to fluently set the horizontal alignment of a panel.

```csharp

var panel = new FlexLayoutPanel();
panel.HorizontalAlign(HorizontalAlignment.Center);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) LayoutStyle\<TPanel>(panel, value)

Sets the layout style of the specified [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel).

| Parameter  | Type                                                                                                         | Description                                                                                                                        |
| ---------- | ------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                                              | The type of the panel, which must inherit from [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel). |
| **panel**  | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions)  | The panel to set the layout style for.                                                                                             |
| **value**  | [FlexLayoutStyle](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel/wisej.web.flexlayoutstyle) | The layout style value to set.                                                                                                     |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions). The modified panel with the updated layout style.

This method allows you to fluently set the layout style of a panel.

```csharp

var panel = new FlexLayoutPanel();
panel.LayoutStyle(FlexLayoutStyle.Wrap);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Spacing\<TPanel>(panel, value)

Sets the spacing between elements in the specified [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel).

| Parameter  | Type                                                                                                        | Description                                                                                                                        |
| ---------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                                             | The type of the panel, which must inherit from [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel). |
| **panel**  | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions) | The panel to set the spacing for.                                                                                                  |
| **value**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                                 | The spacing value to set.                                                                                                          |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions). The modified panel with the updated spacing.

This method allows you to fluently set the spacing between elements in a panel.

```csharp

var panel = new FlexLayoutPanel();
panel.Spacing(10);

```

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) VerticalAlign\<TPanel>(panel, value)

Sets the vertical alignment of the specified [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel).

| Parameter  | Type                                                                                                        | Description                                                                                                                        |
| ---------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                                             | The type of the panel, which must inherit from [FlexLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/flexlayoutpanel). |
| **panel**  | [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions) | The panel to set the vertical alignment for.                                                                                       |
| **value**  | [VerticalAlignment](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.verticalalignment)          | The vertical alignment value to set.                                                                                               |

**Returns:** [TPanel](https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions). The modified panel with the updated vertical alignment.

This method allows you to fluently set the vertical alignment of a panel.

```csharp

var panel = new FlexLayoutPanel();
panel.VerticalAlign(VerticalAlignment.Top);

```
