# LinkLabelExtensions

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 [LinkLabel](/api/wisej.web/content/linklabel.md) class.

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

```csharp
public class LinkLabelExtensions
```

{% endtab %}

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

```visual-basic
Public Class LinkLabelExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) ActiveLinkColor\<TLinkLabel>(linkLabel, activeLinkColor)

Sets the ActiveLinkColor property of the specified [LinkLabel](/api/wisej.web/content/linklabel.md).

| Parameter           | Type                                                                                   | Description                                                                                      |
| ------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| **TLinkLabel**      |                                                                                        | The type of the link label, must inherit from [LinkLabel](/api/wisej.web/content/linklabel.md).  |
| **linkLabel**       | [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md) | The link label for which to set the ActiveLinkColor property.                                    |
| **activeLinkColor** | [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color)                    | The [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) to set for active links. |

**Returns:** [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md). The modified link label with the updated ActiveLinkColor property.

This method allows you to specify the color of active links in the link label.

```csharp

myLinkLabel.ActiveLinkColor(Color.Red);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) DisabledLinkColor\<TLinkLabel>(linkLabel, disabledLinkColor)

Sets the DisabledLinkColor property of the specified [LinkLabel](/api/wisej.web/content/linklabel.md).

| Parameter             | Type                                                                                   | Description                                                                                        |
| --------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **TLinkLabel**        |                                                                                        | The type of the link label, must inherit from [LinkLabel](/api/wisej.web/content/linklabel.md).    |
| **linkLabel**         | [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md) | The link label for which to set the DisabledLinkColor property.                                    |
| **disabledLinkColor** | [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color)                    | The [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) to set for disabled links. |

**Returns:** [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md). The modified link label with the updated DisabledLinkColor property.

This method allows you to specify the color of disabled links in the link label.

```csharp

myLinkLabel.DisabledLinkColor(Color.Gray);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) LinkArea\<TLinkLabel>(linkLabel, linkArea)

Sets the LinkArea property of the specified [LinkLabel](/api/wisej.web/content/linklabel.md).

| Parameter      | Type                                                                                   | Description                                                                                     |
| -------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| **TLinkLabel** |                                                                                        | The type of the link label, must inherit from [LinkLabel](/api/wisej.web/content/linklabel.md). |
| **linkLabel**  | [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md) | The link label for which to set the LinkArea property.                                          |
| **linkArea**   | [LinkArea](/api/wisej.web/content/linklabel/wisej.web.linkarea.md)                     | The [LinkArea](#linkarea``1) to set for the link label.                                         |

**Returns:** [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md). The modified link label with the updated LinkArea property.

This method allows you to specify the area of text that is treated as a link in the link label.

```csharp

myLinkLabel.LinkArea(new LinkArea(0, 10));

```

### ![](/files/lIX317sDtMTZJBi9oSIx) LinkBehavior\<TLinkLabel>(linkLabel, linkBehavior)

Sets the LinkBehavior property of the specified [LinkLabel](/api/wisej.web/content/linklabel.md).

| Parameter        | Type                                                                                   | Description                                                                                     |
| ---------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| **TLinkLabel**   |                                                                                        | The type of the link label, must inherit from [LinkLabel](/api/wisej.web/content/linklabel.md). |
| **linkLabel**    | [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md) | The link label for which to set the LinkBehavior property.                                      |
| **linkBehavior** | [LinkBehavior](/api/wisej.web/enumerations/wisej.web.linkbehavior.md)                  | The [LinkBehavior](#linkbehavior``1) to set for the link label.                                 |

**Returns:** [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md). The modified link label with the updated LinkBehavior property.

This method allows you to specify the behavior of the link label, such as how the link is displayed when the mouse is over it.

```csharp

myLinkLabel.LinkBehavior(LinkBehavior.SystemDefault);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) LinkColor\<TLinkLabel>(linkLabel, linkColor)

Sets the LinkColor property of the specified [LinkLabel](/api/wisej.web/content/linklabel.md).

| Parameter      | Type                                                                                   | Description                                                                                     |
| -------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| **TLinkLabel** |                                                                                        | The type of the link label, must inherit from [LinkLabel](/api/wisej.web/content/linklabel.md). |
| **linkLabel**  | [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md) | The link label for which to set the LinkColor property.                                         |
| **linkColor**  | [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color)                    | The [Color](https://docs.microsoft.com/dotnet/api/system.drawing.color) to set for links.       |

**Returns:** [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md). The modified link label with the updated LinkColor property.

This method allows you to specify the color of links in the link label.

```csharp

myLinkLabel.LinkColor(Color.Blue);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) OnLinkClicked\<TLinkLabel>(linkLabel, action)

Attaches an event handler for the LinkClicked event of the specified [LinkLabel](/api/wisej.web/content/linklabel.md).

| Parameter      | Type                                                                                                        | Description                                                                                     |
| -------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| **TLinkLabel** |                                                                                                             | The type of the link label, must inherit from [LinkLabel](/api/wisej.web/content/linklabel.md). |
| **linkLabel**  | [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md)                      | The link label to attach the event handler to.                                                  |
| **action**     | [Action\<TLinkLabel, LinkLabelLinkClickedEventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | An action to execute when a link is clicked.                                                    |

**Returns:** [TLinkLabel](/api/wisej.web.markup/extensions/wisej.web.markup.linklabelextensions.md). The modified link label with the attached LinkClicked event handler.

This method allows you to execute a custom action whenever a link in the link label is clicked.

```csharp

myLinkLabel.OnLinkClicked((ll, args) =>
{
AlertBox.Show("Link clicked!");
});

```


---

# 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.linklabelextensions.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.
