In This Article

BarControlService Class

A service class that provides attached properties that are used throughout the various bar controls.

public class BarControlService : AvaloniaObject
Inheritance:
object AvaloniaObject object

Properties

Current

The instance of BarControlService for the current thread.

public static BarControlService Current { get; }

Property Value

BarControlService

Remarks

The value of this property is thread-specific and should only be accessed from the same thread that created the control which is using the service.

InputGestureDisplayStringProvider

The provider which will be used to determine the display string of a gesture associated with an object (e.g., "Ctrl+C").

public IInputGestureDisplayStringProvider InputGestureDisplayStringProvider { get; set; }

Property Value

IInputGestureDisplayStringProvider:

The IInputGestureDisplayStringProvider to be used. When not defined, a default InputGestureDisplayStringProvider is used.

KeyTipTextGenerator

The key tip text generator which will be used to automatically create key tip text from various sources (e.g., a label).

public static IKeyTipTextGenerator KeyTipTextGenerator { get; set; }

Property Value

IKeyTipTextGenerator:

The IKeyTipTextGenerator to be used. When not defined, a default KeyTipTextGenerator is used.

LabelGenerator

The label generator that will be used to automatically create labels from various sources (e.g., a key).

public static ILabelGenerator LabelGenerator { get; set; }

Property Value

ILabelGenerator:

The ILabelGenerator to be used. When not defined, a default LabelGenerator is used.

Methods

GetAllowContextMenu(AvaloniaObject)

Gets the value of the AllowContextMenu attached property for the specified object.

public static bool GetAllowContextMenu(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetCanCloneToRibbonQuickAccessToolBar(AvaloniaObject)

Gets the value of the CanCloneToRibbonQuickAccessToolBar attached property for the specified object.

public static bool GetCanCloneToRibbonQuickAccessToolBar(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetCanResolveIcons(AvaloniaObject)

Gets the value of the CanResolveIcons attached property for the specified object.

public static bool GetCanResolveIcons(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetCloneToRibbonQuickAccessToolBarStrategy(AvaloniaObject)

Gets the value of the CloneToRibbonQuickAccessToolBarStrategy attached property for the specified object.

public static CloneToRibbonQuickAccessToolBarStrategy GetCloneToRibbonQuickAccessToolBarStrategy(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

CloneToRibbonQuickAccessToolBarStrategy:

The object's value.

GetHasExternalHeader(AvaloniaObject)

Gets the value of the HasExternalHeader attached property for the specified object.

public static bool GetHasExternalHeader(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetHasLabel(AvaloniaObject)

Gets the value of the HasLabel attached property for the specified object.

public static bool GetHasLabel(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetIconResolved(AvaloniaObject)

Gets the value of the IconResolved attached property for the specified object.

public static object? GetIconResolved(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

object:

The object's value.

GetInputGesture(AvaloniaObject)

Gets the value of the InputGesture attached property for the specified object.

public static KeyGesture? GetInputGesture(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

KeyGesture:

The object's value.

GetIsChecked(AvaloniaObject)

Gets the value of the IsChecked attached property for the specified object.

public static bool GetIsChecked(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetIsInRibbonQuickAccessToolBar(AvaloniaObject)

Gets the value of the IsInRibbonQuickAccessToolBar attached property for the specified object.

public static bool GetIsInRibbonQuickAccessToolBar(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetIsInWindowTitleBar(AvaloniaObject)

Gets the value of the IsInWindowTitleBar attached property for the specified object.

public static bool GetIsInWindowTitleBar(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetIsInputGestureTextVisible(AvaloniaObject)

Gets the value of the IsInputGestureTextVisible attached property for the specified object.

public static bool GetIsInputGestureTextVisible(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetIsLabelVisible(AvaloniaObject)

Gets the value of the IsLabelVisible attached property for the specified object.

public static bool GetIsLabelVisible(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetIsMenuControl(AvaloniaObject)

Gets the value of the IsMenuControl attached property for the specified object.

public static bool GetIsMenuControl(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetIsMenuItemHost(AvaloniaObject)

Gets the value of the IsMenuItemHost attached property for the specified object.

public static bool GetIsMenuItemHost(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetIsOverflowMenuItemHost(AvaloniaObject)

Gets the value of the IsOverflowMenuItemHost attached property for the specified object.

public static bool GetIsOverflowMenuItemHost(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetIsVerticalLayoutOrientationSupported(AvaloniaObject)

Gets the value of the IsVerticalLayoutOrientationSupported attached property for the specified object.

public static bool GetIsVerticalLayoutOrientationSupported(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetItemContainerTemplateSelector(AvaloniaObject)

Gets the value of the ItemContainerTemplateSelector attached property for the specified object.

public static IItemContainerTemplateSelector GetItemContainerTemplateSelector(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

IItemContainerTemplateSelector:

The object's value.

GetItemLayoutOrientation(AvaloniaObject)

Gets the value of the ItemLayoutOrientation attached property for the specified object.

public static Orientation GetItemLayoutOrientation(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

Orientation:

The object's value.

GetKey(AvaloniaObject)

Gets the value of the Key attached property for the specified object.

public static string? GetKey(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

string:

The object's value.

GetLabel(AvaloniaObject)

Gets the value of the Label attached property for the specified object.

public static string? GetLabel(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

string:

The object's value.

GetLargeIcon(AvaloniaObject)

Gets the value of the LargeIcon attached property for the specified object.

public static object? GetLargeIcon(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

object:

The object's value.

GetMediumIcon(AvaloniaObject)

Gets the value of the MediumIcon attached property for the specified object.

public static object? GetMediumIcon(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

object:

The object's value.

GetPanelSpacingSuggestion(AvaloniaObject)

Gets the value of the PanelSpacingSuggestion attached property for the specified object.

public static PanelSpacingSuggestion GetPanelSpacingSuggestion(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

PanelSpacingSuggestion:

The object's value.

GetRootBarControl(AvaloniaObject)

Gets the value of the RootBarControl attached property for the specified object.

public static IRootBarControl? GetRootBarControl(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

IRootBarControl:

The object's value.

GetSmallIcon(AvaloniaObject)

Gets the value of the SmallIcon attached property for the specified object.

public static object? GetSmallIcon(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

object:

The object's value.

GetTitle(AvaloniaObject)

Gets the value of the Title attached property for the specified object.

public static string? GetTitle(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

string:

The object's value.

GetVariantSize(AvaloniaObject)

Gets the value of the VariantSize attached property for the specified object.

public static VariantSize GetVariantSize(AvaloniaObject obj)
Parameter Type Description
obj AvaloniaObject

The object from which the property value is read.

Returns

VariantSize:

The object's value.

SetAllowContextMenu(AvaloniaObject, bool)

Sets the value of the AllowContextMenu attached property to the specified object.

public static void SetAllowContextMenu(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetCanCloneToRibbonQuickAccessToolBar(AvaloniaObject, bool)

Sets the value of the CanCloneToRibbonQuickAccessToolBar attached property to the specified object.

public static void SetCanCloneToRibbonQuickAccessToolBar(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetCanResolveIcons(AvaloniaObject, bool)

Sets the value of the CanResolveIcons attached property to the specified object.

public static void SetCanResolveIcons(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetCloneToRibbonQuickAccessToolBarStrategy(AvaloniaObject, CloneToRibbonQuickAccessToolBarStrategy)

Sets the value of the CloneToRibbonQuickAccessToolBarStrategy attached property to the specified object.

public static void SetCloneToRibbonQuickAccessToolBarStrategy(AvaloniaObject obj, CloneToRibbonQuickAccessToolBarStrategy value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value CloneToRibbonQuickAccessToolBarStrategy

The value to set.

SetHasExternalHeader(AvaloniaObject, bool)

Sets the value of the HasExternalHeader attached property to the specified object.

public static void SetHasExternalHeader(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetInputGesture(AvaloniaObject, KeyGesture?)

Sets the value of the InputGesture attached property to the specified object.

public static void SetInputGesture(AvaloniaObject obj, KeyGesture? value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value KeyGesture

The value to set.

SetIsChecked(AvaloniaObject, bool)

Sets the value of the IsChecked attached property to the specified object.

public static void SetIsChecked(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetIsInputGestureTextVisible(AvaloniaObject, bool)

Sets the value of the IsInputGestureTextVisible attached property to the specified object.

public static void SetIsInputGestureTextVisible(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetIsMenuControl(AvaloniaObject, bool)

Sets the value of the IsMenuControl attached property to the specified object.

public static void SetIsMenuControl(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetIsMenuItemHost(AvaloniaObject, bool)

Sets the value of the IsMenuItemHost attached property to the specified object.

public static void SetIsMenuItemHost(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetIsOverflowMenuItemHost(AvaloniaObject, bool)

Sets the value of the IsOverflowMenuItemHost attached property to the specified object.

public static void SetIsOverflowMenuItemHost(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetIsVerticalLayoutOrientationSupported(AvaloniaObject, bool)

Sets the value of the IsVerticalLayoutOrientationSupported attached property to the specified object.

public static void SetIsVerticalLayoutOrientationSupported(AvaloniaObject obj, bool value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value bool

The value to set.

SetItemContainerTemplateSelector(AvaloniaObject, IItemContainerTemplateSelector)

Sets the value of the ItemContainerTemplateSelector attached property to the specified object.

public static void SetItemContainerTemplateSelector(AvaloniaObject obj, IItemContainerTemplateSelector value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value IItemContainerTemplateSelector

The value to set.

SetItemLayoutOrientation(AvaloniaObject, Orientation)

Sets the value of the ItemLayoutOrientation attached property to the specified object.

public static void SetItemLayoutOrientation(AvaloniaObject obj, Orientation value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value Orientation

The value to set.

SetKey(AvaloniaObject, string?)

Sets the value of the Key attached property to the specified object.

public static void SetKey(AvaloniaObject obj, string? value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value string

The value to set.

SetLabel(AvaloniaObject, string?)

Sets the value of the Label attached property to the specified object.

public static void SetLabel(AvaloniaObject obj, string? value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value string

The value to set.

SetLargeIcon(AvaloniaObject, object?)

Sets the value of the LargeIcon attached property to the specified object.

public static void SetLargeIcon(AvaloniaObject obj, object? value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value object

The value to set.

SetMediumIcon(AvaloniaObject, object?)

Sets the value of the MediumIcon attached property to the specified object.

public static void SetMediumIcon(AvaloniaObject obj, object? value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value object

The value to set.

SetPanelSpacingSuggestion(AvaloniaObject, PanelSpacingSuggestion)

Sets the value of the PanelSpacingSuggestion attached property to the specified object.

public static void SetPanelSpacingSuggestion(AvaloniaObject obj, PanelSpacingSuggestion value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value PanelSpacingSuggestion

The value to set.

SetRootBarControl(AvaloniaObject, IRootBarControl?)

Sets the value of the RootBarControl attached property to the specified object.

public static void SetRootBarControl(AvaloniaObject obj, IRootBarControl? value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value IRootBarControl

The value to set.

SetSmallIcon(AvaloniaObject, object?)

Sets the value of the SmallIcon attached property to the specified object.

public static void SetSmallIcon(AvaloniaObject obj, object? value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value object

The value to set.

SetTitle(AvaloniaObject, string?)

Sets the value of the Title attached property to the specified object.

public static void SetTitle(AvaloniaObject obj, string? value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value string

The value to set.

SetVariantSize(AvaloniaObject, VariantSize)

Sets the value of the VariantSize attached property to the specified object.

public static void SetVariantSize(AvaloniaObject obj, VariantSize value)
Parameter Type Description
obj AvaloniaObject

The object to which the attached property is written.

value VariantSize

The value to set.

Fields

AllowContextMenuProperty

Defines the AllowContextMenu attached property.

public static readonly AttachedProperty<bool> AllowContextMenuProperty

CanCloneToRibbonQuickAccessToolBarProperty

Defines the CanCloneToRibbonQuickAccessToolBar attached property.

public static readonly AttachedProperty<bool> CanCloneToRibbonQuickAccessToolBarProperty

CanResolveIconsProperty

Defines the CanResolveIcons attached property.

public static readonly AttachedProperty<bool> CanResolveIconsProperty

CloneToRibbonQuickAccessToolBarStrategyProperty

Defines the CloneToRibbonQuickAccessToolBarStrategy attached property.

public static readonly AttachedProperty<CloneToRibbonQuickAccessToolBarStrategy> CloneToRibbonQuickAccessToolBarStrategyProperty

HasExternalHeaderProperty

Defines the HasExternalHeader attached property.

public static readonly AttachedProperty<bool> HasExternalHeaderProperty

HasLabelProperty

Defines the HasLabel attached property.

public static readonly AttachedProperty<bool> HasLabelProperty

IconResolvedProperty

Defines the IconResolved attached property.

public static readonly AttachedProperty<object?> IconResolvedProperty

InputGestureProperty

Defines the InputGesture attached property.

public static readonly AttachedProperty<KeyGesture?> InputGestureProperty

IsCheckedProperty

Defines the IsChecked attached property.

public static readonly AttachedProperty<bool> IsCheckedProperty

IsInRibbonQuickAccessToolBarProperty

Defines the IsInRibbonQuickAccessToolBar attached property.

public static readonly AttachedProperty<bool> IsInRibbonQuickAccessToolBarProperty

IsInWindowTitleBarProperty

Defines the IsInWindowTitleBar attached property.

public static readonly AttachedProperty<bool> IsInWindowTitleBarProperty

IsInputGestureTextVisibleProperty

Defines the IsInputGestureTextVisible attached property.

public static readonly AttachedProperty<bool> IsInputGestureTextVisibleProperty

IsLabelVisibleProperty

Defines the IsLabelVisible attached property.

public static readonly AttachedProperty<bool> IsLabelVisibleProperty

IsMenuControlProperty

Defines the IsMenuControl attached property.

public static readonly AttachedProperty<bool> IsMenuControlProperty

IsMenuItemHostProperty

Defines the IsMenuItemHost attached property.

public static readonly AttachedProperty<bool> IsMenuItemHostProperty

IsOverflowMenuItemHostProperty

Defines the IsOverflowMenuItemHost attached property.

public static readonly AttachedProperty<bool> IsOverflowMenuItemHostProperty

IsVerticalLayoutOrientationSupportedProperty

Defines the IsVerticalLayoutOrientationSupported attached property.

public static readonly AttachedProperty<bool> IsVerticalLayoutOrientationSupportedProperty

ItemContainerTemplateSelectorProperty

Defines the ItemContainerTemplateSelector attached property.

public static readonly AttachedProperty<IItemContainerTemplateSelector> ItemContainerTemplateSelectorProperty

ItemLayoutOrientationProperty

Defines the ItemLayoutOrientation attached property.

public static readonly AttachedProperty<Orientation> ItemLayoutOrientationProperty

KeyProperty

Defines the Key attached property.

public static readonly AttachedProperty<string?> KeyProperty

LabelProperty

Defines the Label attached property.

public static readonly AttachedProperty<string?> LabelProperty

LargeIconProperty

Defines the LargeIcon attached property.

public static readonly AttachedProperty<object?> LargeIconProperty

MediumIconProperty

Defines the MediumIcon attached property.

public static readonly AttachedProperty<object?> MediumIconProperty

PanelSpacingSuggestionProperty

Defines the PanelSpacingSuggestion attached property.

public static readonly AttachedProperty<PanelSpacingSuggestion> PanelSpacingSuggestionProperty

RootBarControlProperty

Defines the RootBarControl attached property.

public static readonly AttachedProperty<IRootBarControl?> RootBarControlProperty

SmallIconProperty

Defines the SmallIcon attached property.

public static readonly AttachedProperty<object?> SmallIconProperty

TitleProperty

Defines the Title attached property.

public static readonly AttachedProperty<string?> TitleProperty

ToolBarItemCollapseBehaviorProperty

Defines the ToolBarItemCollapseBehavior attached property.

public static readonly AttachedProperty<ItemCollapseBehavior> ToolBarItemCollapseBehaviorProperty

ToolBarItemVariantBehaviorProperty

Defines the ToolBarItemVariantBehavior attached property.

public static readonly AttachedProperty<ItemVariantBehavior> ToolBarItemVariantBehaviorProperty

VariantSizeProperty

Defines the VariantSize attached property.

public static readonly AttachedProperty<VariantSize> VariantSizeProperty

Inherited Members

Extension Methods