In This Article

BarControlService Class

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

public class BarControlService
Inheritance:
object 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.

DefaultImageStretchDirection

The default StretchDirection to apply to images in the controls in this library.

public static StretchDirection DefaultImageStretchDirection { get; set; }

Property Value

StretchDirection:

The default value is DownOnly.

Remarks

If an alternative stretch direction is required, such as Both, set this property at application startup prior to any UI being initialized.

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 which 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(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetCanCloneToRibbonQuickAccessToolBar(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetCanResolveImageSources(DependencyObject)

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

public static bool GetCanResolveImageSources(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

bool

GetCloneToRibbonQuickAccessToolBarStrategy(DependencyObject)

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

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

The object from which the property value is read.

Returns

CloneToRibbonQuickAccessToolBarStrategy

GetHasExternalHeader(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetHasLabel(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetImageSourceResolved(DependencyObject)

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

public static ImageSource? GetImageSourceResolved(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

ImageSource

GetInputGestureText(DependencyObject)

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

public static string? GetInputGestureText(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

string

GetInvocationFocusBehavior(DependencyObject)

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

public static InvocationFocusBehavior GetInvocationFocusBehavior(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

InvocationFocusBehavior

GetIsChecked(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetIsInPopupButton(DependencyObject)

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

public static bool GetIsInPopupButton(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

bool

GetIsInRibbonQuickAccessToolBar(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetIsInWindowTitleBar(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetIsInputGestureTextVisible(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetIsLabelVisible(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetIsMenuControl(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetIsMenuItemHost(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetIsOverflowMenuItemHost(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetIsVerticalLayoutOrientationSupported(DependencyObject)

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

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

The object from which the property value is read.

Returns

bool

GetItemContainerTemplateSelector(DependencyObject)

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

public static ItemContainerTemplateSelector? GetItemContainerTemplateSelector(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

ItemContainerTemplateSelector

GetItemLayoutOrientation(DependencyObject)

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

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

The object from which the property value is read.

Returns

Orientation

GetKey(DependencyObject)

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

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

The object from which the property value is read.

Returns

string

GetLabel(DependencyObject)

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

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

The object from which the property value is read.

Returns

string

GetLargeImageSource(DependencyObject)

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

public static ImageSource? GetLargeImageSource(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

ImageSource

GetMediumImageSource(DependencyObject)

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

public static ImageSource? GetMediumImageSource(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

ImageSource:

The object's value.

GetPanelSpacingSuggestion(DependencyObject)

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

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

The object from which the property value is read.

Returns

PanelSpacingSuggestion

GetRootBarControl(DependencyObject)

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

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

The object from which the property value is read.

Returns

IRootBarControl

GetSmallImageSource(DependencyObject)

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

public static ImageSource? GetSmallImageSource(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

ImageSource

GetTitle(DependencyObject)

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

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

The object from which the property value is read.

Returns

string

GetToolBarItemCollapseBehavior(DependencyObject)

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

public static ItemCollapseBehavior GetToolBarItemCollapseBehavior(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

ItemCollapseBehavior

GetToolBarItemVariantBehavior(DependencyObject)

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

public static ItemVariantBehavior GetToolBarItemVariantBehavior(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

ItemVariantBehavior

GetVariantSize(DependencyObject)

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

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

The object from which the property value is read.

Returns

VariantSize

SetAllowContextMenu(DependencyObject, bool)

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

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

The object to which the attached property is written.

value bool

The value to set.

SetCanCloneToRibbonQuickAccessToolBar(DependencyObject, bool)

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

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

The object to which the attached property is written.

value bool

The value to set.

SetCanResolveImageSources(DependencyObject, bool)

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

public static void SetCanResolveImageSources(DependencyObject obj, bool value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value bool

The value to set.

SetCloneToRibbonQuickAccessToolBarStrategy(DependencyObject, CloneToRibbonQuickAccessToolBarStrategy)

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

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

The object to which the attached property is written.

value CloneToRibbonQuickAccessToolBarStrategy

The value to set.

SetHasExternalHeader(DependencyObject, bool)

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

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

The object to which the attached property is written.

value bool

The value to set.

SetInputGestureText(DependencyObject, string?)

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

public static void SetInputGestureText(DependencyObject obj, string? value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value string

The value to set.

SetInvocationFocusBehavior(DependencyObject, InvocationFocusBehavior)

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

public static void SetInvocationFocusBehavior(DependencyObject obj, InvocationFocusBehavior value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value InvocationFocusBehavior

The value to set.

SetIsChecked(DependencyObject, bool)

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

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

The object to which the attached property is written.

value bool

The value to set.

SetIsInWindowTitleBar(DependencyObject, bool)

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

public static void SetIsInWindowTitleBar(DependencyObject obj, bool value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value bool

The value to set.

SetIsInputGestureTextVisible(DependencyObject, bool)

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

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

The object to which the attached property is written.

value bool

The value to set.

SetIsLabelVisible(DependencyObject, bool)

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

public static void SetIsLabelVisible(DependencyObject obj, bool value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value bool

The value to set.

SetIsMenuControl(DependencyObject, bool)

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

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

The object to which the attached property is written.

value bool

The value to set.

SetIsMenuItemHost(DependencyObject, bool)

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

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

The object to which the attached property is written.

value bool

The value to set.

SetIsOverflowMenuItemHost(DependencyObject, bool)

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

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

The object to which the attached property is written.

value bool

The value to set.

SetIsVerticalLayoutOrientationSupported(DependencyObject, bool)

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

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

The object to which the attached property is written.

value bool

The value to set.

SetItemContainerTemplateSelector(DependencyObject, ItemContainerTemplateSelector?)

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

public static void SetItemContainerTemplateSelector(DependencyObject obj, ItemContainerTemplateSelector? value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value ItemContainerTemplateSelector

The value to set.

SetItemLayoutOrientation(DependencyObject, Orientation)

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

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

The object to which the attached property is written.

value Orientation

The value to set.

SetKey(DependencyObject, string?)

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

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

The object to which the attached property is written.

value string

The value to set.

SetLabel(DependencyObject, string?)

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

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

The object to which the attached property is written.

value string

The value to set.

SetLargeImageSource(DependencyObject, ImageSource?)

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

public static void SetLargeImageSource(DependencyObject obj, ImageSource? value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value ImageSource

The value to set.

SetMediumImageSource(DependencyObject, ImageSource?)

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

public static void SetMediumImageSource(DependencyObject obj, ImageSource? value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value ImageSource

The value to set.

SetPanelSpacingSuggestion(DependencyObject, PanelSpacingSuggestion)

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

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

The object to which the attached property is written.

value PanelSpacingSuggestion

The value to set.

SetRootBarControl(DependencyObject, IRootBarControl?)

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

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

The object to which the attached property is written.

value IRootBarControl

The value to set.

SetSmallImageSource(DependencyObject, ImageSource?)

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

public static void SetSmallImageSource(DependencyObject obj, ImageSource? value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value ImageSource

The value to set.

SetTitle(DependencyObject, string?)

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

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

The object to which the attached property is written.

value string

The value to set.

SetToolBarItemCollapseBehavior(DependencyObject, ItemCollapseBehavior)

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

public static void SetToolBarItemCollapseBehavior(DependencyObject obj, ItemCollapseBehavior value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value ItemCollapseBehavior

The value to set.

SetToolBarItemVariantBehavior(DependencyObject, ItemVariantBehavior)

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

public static void SetToolBarItemVariantBehavior(DependencyObject obj, ItemVariantBehavior value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value ItemVariantBehavior

The value to set.

SetVariantSize(DependencyObject, VariantSize)

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

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

The object to which the attached property is written.

value VariantSize

The value to set.

Fields

AllowContextMenuProperty

Defines the AllowContextMenu property.

public static readonly DependencyProperty AllowContextMenuProperty

CanCloneToRibbonQuickAccessToolBarProperty

Defines the CanCloneToRibbonQuickAccessToolBar property.

public static readonly DependencyProperty CanCloneToRibbonQuickAccessToolBarProperty

CanResolveImageSourcesProperty

Defines the CanResolveImageSources property.

public static readonly DependencyProperty CanResolveImageSourcesProperty

CloneToRibbonQuickAccessToolBarStrategyProperty

Defines the CloneToRibbonQuickAccessToolBarStrategy property.

public static readonly DependencyProperty CloneToRibbonQuickAccessToolBarStrategyProperty

HasExternalHeaderProperty

Defines the HasExternalHeader property.

public static readonly DependencyProperty HasExternalHeaderProperty

HasLabelProperty

Defines the HasLabel property.

public static readonly DependencyProperty HasLabelProperty

ImageSourceResolvedProperty

Defines the ImageSourceResolved property.

public static readonly DependencyProperty ImageSourceResolvedProperty

InputGestureTextProperty

Defines the InputGestureText property.

public static readonly DependencyProperty InputGestureTextProperty

InvocationFocusBehaviorProperty

Defines the InvocationFocusBehavior property.

public static readonly DependencyProperty InvocationFocusBehaviorProperty

IsCheckedProperty

Defines the IsChecked property.

public static readonly DependencyProperty IsCheckedProperty

IsInPopupButtonProperty

Defines the IsInPopupButton property.

public static readonly DependencyProperty IsInPopupButtonProperty

IsInRibbonQuickAccessToolBarProperty

Defines the IsInRibbonQuickAccessToolBar property.

public static readonly DependencyProperty IsInRibbonQuickAccessToolBarProperty

IsInWindowTitleBarProperty

Defines the IsInWindowTitleBar property.

public static readonly DependencyProperty IsInWindowTitleBarProperty

IsInputGestureTextVisibleProperty

Defines the IsInputGestureTextVisible property.

public static readonly DependencyProperty IsInputGestureTextVisibleProperty

IsLabelVisibleProperty

Defines the IsLabelVisible property.

public static readonly DependencyProperty IsLabelVisibleProperty

IsMenuControlProperty

Defines the IsMenuControl property.

public static readonly DependencyProperty IsMenuControlProperty

IsMenuItemHostProperty

Defines the IsMenuItemHost property.

public static readonly DependencyProperty IsMenuItemHostProperty

IsOverflowMenuItemHostProperty

Defines the IsOverflowMenuItemHost property.

public static readonly DependencyProperty IsOverflowMenuItemHostProperty

IsVerticalLayoutOrientationSupportedProperty

Defines the IsVerticalLayoutOrientationSupported property.

public static readonly DependencyProperty IsVerticalLayoutOrientationSupportedProperty

ItemContainerTemplateSelectorProperty

Defines the ItemContainerTemplateSelector property.

public static readonly DependencyProperty ItemContainerTemplateSelectorProperty

ItemLayoutOrientationProperty

Defines the ItemLayoutOrientation property.

public static readonly DependencyProperty ItemLayoutOrientationProperty

KeyProperty

Defines the Key property.

public static readonly DependencyProperty KeyProperty

LabelProperty

Defines the Label property.

public static readonly DependencyProperty LabelProperty

LargeImageSourceProperty

Defines the LargeImageSource property.

public static readonly DependencyProperty LargeImageSourceProperty

MediumImageSourceProperty

Defines the MediumImageSource property.

public static readonly DependencyProperty MediumImageSourceProperty

PanelSpacingSuggestionProperty

Defines the PanelSpacingSuggestion property.

public static readonly DependencyProperty PanelSpacingSuggestionProperty

RootBarControlProperty

Defines the RootBarControl property.

public static readonly DependencyProperty RootBarControlProperty

SmallImageSourceProperty

Defines the SmallImageSource property.

public static readonly DependencyProperty SmallImageSourceProperty

TitleProperty

Defines the Title property.

public static readonly DependencyProperty TitleProperty

ToolBarItemCollapseBehaviorProperty

Defines the ToolBarItemCollapseBehavior property.

public static readonly DependencyProperty ToolBarItemCollapseBehaviorProperty

ToolBarItemVariantBehaviorProperty

Defines the ToolBarItemVariantBehavior property.

public static readonly DependencyProperty ToolBarItemVariantBehaviorProperty

VariantSizeProperty

Defines the VariantSize property.

public static readonly DependencyProperty VariantSizeProperty

Inherited Members

Extension Methods