Перейти к основному содержимому

Class TabViewExtensions

Namespace: Aspid.FastTools.UIElements
Assembly: Aspid.FastTools.dll

Provides extension methods for TabView.

public static class TabViewExtensions

Inheritance​

object ← TabViewExtensions

Methods​

AddActiveTabChanged<T>(T, Action<Tab, Tab>)​

Subscribes to the activeTabChanged event.

public static T AddActiveTabChanged<T>(this T element, Action<Tab, Tab> value) where T : TabView

Parameters​

element T

The element to modify.

value Action<Tab, Tab>

The callback to subscribe; it receives the previous and the new active tab.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

AddTabClosed<T>(T, Action<Tab, int>)​

Subscribes to the tabClosed event.

public static T AddTabClosed<T>(this T element, Action<Tab, int> value) where T : TabView

Parameters​

element T

The element to modify.

value Action<Tab, int>

The callback to subscribe; it receives the closed tab and its former index.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

AddTabReordered<T>(T, Action<int, int>)​

Subscribes to the tabReordered event.

public static T AddTabReordered<T>(this T element, Action<int, int> value) where T : TabView

Parameters​

element T

The element to modify.

value Action<int, int>

The callback to subscribe; it receives the old and the new tab index.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

RemoveActiveTabChanged<T>(T, Action<Tab, Tab>)​

Unsubscribes from the activeTabChanged event.

public static T RemoveActiveTabChanged<T>(this T element, Action<Tab, Tab> value) where T : TabView

Parameters​

element T

The element to modify.

value Action<Tab, Tab>

The callback to remove.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

RemoveTabClosed<T>(T, Action<Tab, int>)​

Unsubscribes from the tabClosed event.

public static T RemoveTabClosed<T>(this T element, Action<Tab, int> value) where T : TabView

Parameters​

element T

The element to modify.

value Action<Tab, int>

The callback to remove.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

RemoveTabReordered<T>(T, Action<int, int>)​

Unsubscribes from the tabReordered event.

public static T RemoveTabReordered<T>(this T element, Action<int, int> value) where T : TabView

Parameters​

element T

The element to modify.

value Action<int, int>

The callback to remove.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

SetActiveTab<T>(T, Tab)​

Sets activeTab.

public static T SetActiveTab<T>(this T element, Tab value) where T : TabView

Parameters​

element T

The element to modify.

value Tab

The tab to activate.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

Remarks​

Unity throws when value is not a tab of this view, so add the tabs first.

SetReorderable<T>(T, bool)​

Sets reorderable.

public static T SetReorderable<T>(this T element, bool value) where T : TabView

Parameters​

element T

The element to modify.

value bool

When true, tabs can be reordered by dragging their headers.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

SetSelectedTabIndex<T>(T, int)​

Sets selectedTabIndex.

public static T SetSelectedTabIndex<T>(this T element, int value) where T : TabView

Parameters​

element T

The element to modify.

value int

The index of the tab to activate.

Returns​

T

The element, for chaining.

Type Parameters​

T

The element type.

Remarks​

Unity ignores an index outside the tab range, so add the tabs first.