# 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](/api/wisej.web/containers/flexlayoutpanel.md) class.

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

```csharp
public class FlexLayoutPanelExtensions
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) AlignX\<TPanel>(panel, control, value)

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

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

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) AlignY\<TPanel>(panel, control, value)

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

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

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) FillWeight\<TPanel>(panel, control, value)

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

| Parameter   | Type                                                                                     | Description                                                                                                     |
| ----------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| **TPanel**  |                                                                                          | The type of the panel, which must inherit from [FlexLayoutPanel](/api/wisej.web/containers/flexlayoutpanel.md). |
| **panel**   | [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions.md) | The panel containing the control.                                                                               |
| **control** | [Control](/api/wisej.web/general/control.md)                                             | 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](/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) HorizontalAlign\<TPanel>(panel, value)

Sets the horizontal alignment of the specified [FlexLayoutPanel](/api/wisej.web/containers/flexlayoutpanel.md).

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

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) LayoutStyle\<TPanel>(panel, value)

Sets the layout style of the specified [FlexLayoutPanel](/api/wisej.web/containers/flexlayoutpanel.md).

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

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Spacing\<TPanel>(panel, value)

Sets the spacing between elements in the specified [FlexLayoutPanel](/api/wisej.web/containers/flexlayoutpanel.md).

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

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions.md). 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);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) VerticalAlign\<TPanel>(panel, value)

Sets the vertical alignment of the specified [FlexLayoutPanel](/api/wisej.web/containers/flexlayoutpanel.md).

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

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions.md). 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);

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.flexlayoutpanelextensions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
