Table of Contents

Class TripousAvalonExtensions

Namespace
Tripous.Desktop
Assembly
Tripous.Desktop.dll

Provides extension methods for Avalonia controls.

public static class TripousAvalonExtensions
Inheritance
TripousAvalonExtensions
Inherited Members

Methods

AsInt(TextBox, int?)

Returns the text box value as an integer.

public static int AsInt(this TextBox Box, int? Default = null)

Parameters

Box TextBox

The text box.

Default int?

The default value.

Returns

int

The integer value.

Close(TabItem)

Closes a tab item by removing it from its parent tab control.

public static void Close(this TabItem Page)

Parameters

Page TabItem

The tab item.

GetText(AutoCompleteBox)

Returns trimmed text from an auto-complete box.

public static string GetText(this AutoCompleteBox Box)

Parameters

Box AutoCompleteBox

The auto-complete box.

Returns

string

The trimmed text.

GetText(ComboBox)

Returns trimmed text from a combo box.

public static string GetText(this ComboBox Box)

Parameters

Box ComboBox

The combo box.

Returns

string

The trimmed text.

GetText(TextBox)

Returns trimmed text from a text box.

public static string GetText(this TextBox Box)

Parameters

Box TextBox

The text box.

Returns

string

The trimmed text.

GetText(TextEditor)

Returns trimmed text from a text editor.

public static string GetText(this TextEditor Box)

Parameters

Box TextEditor

The text editor.

Returns

string

The trimmed text.

GetTextAlignment(Type)

Returns the text alignment for a type.

public static TextAlignment GetTextAlignment(this Type T)

Parameters

T Type

The type.

Returns

TextAlignment

The text alignment.

GetTextAlignment(DataFieldType)

Returns the text alignment for a data field type.

public static TextAlignment GetTextAlignment(this DataFieldType DataType)

Parameters

DataType DataFieldType

The data field type.

Returns

TextAlignment

The text alignment.

GetTextAsLines(TextBox)

Returns the text box text as trimmed non-empty lines.

public static string[] GetTextAsLines(this TextBox Box)

Parameters

Box TextBox

The text box.

Returns

string[]

The text lines.

GetValue(CheckBox)

Returns the checked value of a check box.

public static bool GetValue(this CheckBox Box)

Parameters

Box CheckBox

The check box.

Returns

bool

True if the check box is checked; otherwise, false.

PerformClick(Button)

Raises the click event of a button.

public static void PerformClick(this Button Button)

Parameters

Button Button

The button.

TabItem_MiddleClick(object, PointerPressedEventArgs)

Handles middle-click closing for a tab item.

public static void TabItem_MiddleClick(object sender, PointerPressedEventArgs e)

Parameters

sender object

The event sender.

e PointerPressedEventArgs

The pointer event arguments.