Table of Contents

Class ControlExtensions

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

Adds common functionality to Control.

public static class ControlExtensions
Inheritance
ControlExtensions
Inherited Members

Methods

BringIntoView(Control)

Tries to bring the control into view.

public static void BringIntoView(this Control control)

Parameters

control Control

The control.

BringIntoView(Control, Rect)

Tries to bring the control into view.

public static void BringIntoView(this Control control, Rect rect)

Parameters

control Control

The control.

rect Rect

The area of the control to being into view.

FindControl<T>(Control, string)

Finds the named control in the scope of the specified control.

public static T? FindControl<T>(this Control control, string name) where T : Control

Parameters

control Control

The control to look in.

name string

The name of the control to find.

Returns

T

The control or null if not found.

Type Parameters

T

The type of the control to find.

GetControl<T>(Control, string)

Finds the named control in the scope of the specified control and throws if not found.

public static T GetControl<T>(this Control control, string name) where T : Control

Parameters

control Control

The control to look in.

name string

The name of the control to find.

Returns

T

The control.

Type Parameters

T

The type of the control to find.

Set(IPseudoClasses, string, IObservable<bool>)

Sets a pseudoclass depending on an observable trigger.

public static IDisposable Set(this IPseudoClasses classes, string name, IObservable<bool> trigger)

Parameters

classes IPseudoClasses

The pseudoclasses collection.

name string

The name of the pseudoclass to set.

trigger IObservable<bool>

The trigger: true adds the pseudoclass, false removes.

Returns

IDisposable

A disposable used to cancel the subscription.