Skip to end of metadata
Go to start of metadata

Remarks

UXRibbonBar is a sophisticated command bar that organizes program's features into a series of tabs at the top of a window. The ribbon user interface increases discoverability of features and functions which enables quicker learning of the program as a whole, and makes users feel more in control of their experience with the program. A ribbon can replace both the traditional menu bar and toolbars. UXRibbonBar supports unified API for both Silverlight and WPF application development.

Commands in UXRibbonBar can be grouped into several tabs. In each tab, commands can be further categorized into several groups. It gives you the flexibility to control the grouping of your application commands which allow users to quickly learn the functionality available in your application. In addition, you can specify most frequently accessed commands in ApplicationMenu and QuickAccessToolbar.

The following code shows how to create a simple UXRibbonBar with commands in application menu, backstage menu, quick access toolbar, three tabs and two groups in the first tab.

XAML

The following figure shows the results of the example above.

There are two types of group that you can choose from. Each group type has different behaviors and configurations which will be covered in the latter section of this topic.
To learn more about UXRibbonBar, see UXRibbonBar Overview.

Working with ActiveContextualTabs Property and ContextualTabGroups Property

Contextual tab is a unique ribbon concept that defines the tab's visibility based on a specific context. The contextual tab is useful to hide application commands that are irrelevant unless certain context is available. For example, you can design the ribbon to show the search related commands when the search textbox is focused, such as shown in the illustration below.

To use contextual tab in UXRibbonBar, you need to configure several things as follows:

  • Define a UXRibbonContextualTabGroup with a unique name and some other attributes such as Content for the display text, Background and IndicatorBackground for the visual brushes.
  • Specify which tab belongs to which contextual group. You set the ContextualTabGroupName property to the unique name of UXRibbonContextualTabGroup you defined earlier.
  • Set the ActiveContextualTabs property of UXRibbonBar to determine the active contextual tab groups. To activate multiple contextual tab groups, set the property with each tab group name separated by comma character.

The following code shows how to configure the contextual tabs and set the active contextual tab initially.

XAML

The result looks like the following figure.

Working with ApplicationMenu Property

Application menu is a control that can be accessed from the top left corner of the ribbon. There are two types of item that you can define in UXRibbonApplicationMenu which are UXRibbonApplicationMenuItem and UXRibbonApplicationBackstageMenuItem.

UXRibbonApplicationMenuItem is a command control which behaves similar to UXMenuItem. To learn more about UXMenuItem, see UXDropDownButton Overview. On the other hands, UXRibbonApplicationBackstageMenuItem is a more sophisticated control that displays custom content when the menu item is active.

The following code shows how to define three UXRibbonApplicationMenuItem and one UXRibbonApplicationBackstageMenuItem. Notice that the "Exit" menu item has a command assigned.

XAML

The following figure shows the application menu when a backstage menu item is active.

Working with IsExpanded Property

You can also minimize the ribbon bar by clicking on the arrow button in the top-right side of the ribbon, or double click on the active tab. You can also set the IsExpanded property to expand or minimize the ribbon bar. See the following illustration.

Working with QuickAccessToolBar Property

UXRibbonQuickAccessToolbar is a ribbon-friendly control that provides quick access to frequently accessed commands such as New, Open, Save and Print. You can hide the commands initially by setting the Visibility property to Collapsed. At runtime, users can show the hidden commands through the dropdown menu in the quick access toolbar.

By default, the position of UXRibbonQuickAccessToolbar is set to the top of UXRibbonBar. If you prefer, you can set the position to the bottom by setting the ToolBarPosition property to Bottom.

UXRibbonQuickAccessToolbar derives from UXToolbar which is an advanced, rich-featured toolbar control with elegant built-in styles and built-in support for various button types such as described below.

  • Button
    Represents a standard command button.

  • DropdownButton
    Represents a button that displays dropdown menu when clicked, which can contain a collection of menu items and nested menu items similar to UXContextMenu.

  • SplitButton
    Represents a combination of command button and a dropdown menu. This type of button typically provides users with a default command that executed when the command part of the button is clicked, while at the same time allowing users to choose alternative commands through the dropdown arrow. Similar to the DropdownButton, you can also define a collection of menu items and nested menu items as in UXContextMenu.

  • Custom
    Represents a custom button that can be used to contain any UIElement or controls. With this type, the default layout properties such as margin and padding as well as the UI behaviors would be disabled. Consequently, this type is ideal to host custom controls such as text box, combo box, date picker and others.

The following code shows how to add UXRibbonQuickAccessToolbar to the ribbon control with several buttons using different button type.

XAML

The result looks like the following figure.

Using Commands in Quick Access Toolbar

The following example shows how to assign a command to a UXRibbonToolBarButton which will be executed when the item is pressed.

XAML

Definition

public class UXRibbonBar : ISSelectionControl

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXRibbonBar Constructor()Creates a new instance of UXRibbonBar class.

Public Properties

ActiveContextualTabsGets or sets a value that determines which contextual tabs are active.
ApplicationMenuGets or sets a value that represents an object instance of UXRibbonApplicationMenu.
ApplicationMenuVisibilityGets or sets a value that indicates whether the application menu is visible.
AutoCreateApplicationMenuGets or sets a value indicating whether the application menu should be automatically created eventhough it is not defined.
AutoCreateQuickAccessToolBarGets or sets a value indicating whether the quick access toolbar should be automatically created eventhough it is not defined.
CloseTextGets or sets a value that determines the window close tooltip text.
ContextualTabGroupsGets the collection of contextual tab groups in the ribbon control.
ContextualTabGroupsSourceGets or sets a value that represents the items for contextual tab groups.
ControlBoxPositionGets or sets a value that specifies the window control box position.
ControlBoxVisibilityGets or sets a value that determines whether the window control box is visible.
ExpandButtonVisibilityGets or sets a value that indicates whether the expand button is visible.
HeaderHeightGets or sets a value indicating the height of the header element.
HeaderVisibilityGets or sets a value that indicates whether the header is visible.
HelpButtonContentGets or sets the content to display in the help button element.
HelpButtonDisplayModeGets or sets a value that indicates the display mode of the help button element.
HelpButtonIconGets or sets a image source for the help button element.
HelpButtonVisibilityGets or sets a value that indicates whether the help button is visible.
HelpCommandGets or sets the command to invoke when this button is clicked.
HelpCommandCannotExecuteGets or sets the UI behavior when the associated Command cannot be executed.
HelpCommandParameterGets or sets the parameter to pass to the Command property.
HelpCommandTargetGets or sets the element on which to raise the specified command.
IconGets or sets a value that determines the icon of the ribbon control.
IsExpandedGets or sets a value indicating whether the ribbon is expanded.
MaximizeTextGets or sets a value that determines the window maximize tooltip text.
MinimizeTextGets or sets a value that determines the window minimize tooltip text.
MinRibbonBarHeightGets or sets a value that determines the minimum height of the ribbon bar.
QuickAccessToolBarGets or sets a value that represents an object instance of UXRibbonQuickAccessToolBar.
RestoreDownTextGets or sets a value that determines the window restore down tooltip text.
RibbonButtonStyle 
RibbonCheckBoxStyle 
RibbonComboBoxStyle 
RibbonDropDownButtonStyle 
RibbonFieldLabelStyle 
RibbonGalleryListStyle 
RibbonGalleryStyle 
RibbonOrderedTabGroupStyle 
RibbonRadioButtonStyle 
RibbonSeparatorStyle 
RibbonSplitButtonStyle 
RibbonTabGroupStyle 
RibbonTitleGets or sets a value that specifies the title of the ribbon control.
RibbonToggleButtonStyle 
RibbonToolBarButtonStyle 
RibbonToolTipStyleGets or sets the style to apply to the ribbon tooltip.
TabBarVisibilityGets or sets a value indicating whether the tab bar element is visible.
TitleEffectGets or sets a value that specifies the effect of ribbon title.
TitleStyleGets or sets the style to apply to the title element.
WindowBackgroundGets or sets a value that determines the window background.
WindowBorderBrushGets or sets a value that determines the window border brush.
WindowBorderThicknessGets or sets a value that determines the thickness of the window border.

Protected Properties

ProductProduct Info.

Fields

ActiveContextualTabsPropertyIdentifies the ActiveContextualTabs dependency property.
ApplicationMenuPropertyIdentifies the ApplicationMenu dependency property.
ApplicationMenuVisibilityPropertyIdentifies the ApplicationMenuVisibility dependency property.
AutoCreateApplicationMenuPropertyIdentifies the AutoCreateApplicationMenu dependency property.
AutoCreateQuickAccessToolBarPropertyIdentifies the AutoCreateQuickAccessToolBar dependency property.
CloseTextPropertyIdentifies the CloseText dependency property.
ContextualTabGroupsSourcePropertyIdentifies the ContextualTabGroupsSource dependency property.
ControlBoxPositionPropertyIdentifies the ControlBoxPosition dependency property.
ControlBoxVisibilityPropertyIdentifies the ControlBoxVisibility dependency property.
ExpandButtonVisibilityPropertyIdentifies the ExpandButtonVisibility dependency property.
HeaderHeightPropertyIdentifies the HeaderHeight dependency property.
HeaderVisibilityPropertyIdentifies the HeaderVisibility dependency property.
HelpButtonContentPropertyIdentifies the HelpButtonContent dependency property.
HelpButtonDisplayModePropertyIdentifies the HelpButtonDisplayMode dependency property.
HelpButtonIconPropertyIdentifies the HelpButtonIcon dependency property.
HelpButtonVisibilityPropertyIdentifies the HelpButtonVisibility dependency property.
HelpCommandCannotExecutePropertyIdentifies the HelpCommandCannotExecute dependency property.
HelpCommandParameterPropertyIdentifies the HelpCommandParameter dependency property.
HelpCommandPropertyIdentifies the HelpCommand dependency property.
HelpCommandTargetPropertyIdentifies the HelpCommandTarget dependency property.
IconPropertyIdentifies the Icon dependency property.
IsExpandedPropertyIdentifies the IsExpanded dependency property.
MaximizeTextPropertyIdentifies the MaximizeText dependency property.
MinimizeTextPropertyIdentifies the MinimizeText dependency property.
MinRibbonBarHeightPropertyIdentifies the MinRibbonBarHeight dependency property.
QuickAccessToolBarPropertyIdentifies the QuickAccessToolBar dependency property.
RestoreDownTextPropertyIdentifies the RestoreDownText dependency property.
ReturnLastFocusPropertyIdentifies the ReturnLastFocus attached property.
RibbonButtonStylePropertyIdentifies the RibbonButtonStyle dependency property.
RibbonCheckBoxStylePropertyIdentifies the RibbonCheckBoxStyle dependency property.
RibbonComboBoxStylePropertyIdentifies the RibbonComboBoxStyle dependency property.
RibbonDropDownButtonStylePropertyIdentifies the RibbonDropDownButtonStyle dependency property.
RibbonFieldLabelStylePropertyIdentifies the RibbonFieldLabelStyle dependency property.
RibbonGalleryListStylePropertyIdentifies the RibbonGalleryListStyle dependency property.
RibbonGalleryStylePropertyIdentifies the RibbonGalleryStyle dependency property.
RibbonOrderedTabGroupStylePropertyIdentifies the RibbonOrderedTabGroupStyle dependency property.
RibbonRadioButtonStylePropertyIdentifies the RibbonRadioButtonStyle dependency property.
RibbonSeparatorStylePropertyIdentifies the RibbonSeparatorStyle dependency property.
RibbonSplitButtonStylePropertyIdentifies the RibbonSplitButtonStyle dependency property.
RibbonTabGroupStylePropertyIdentifies the RibbonTabGroupStyle dependency property.
RibbonTitlePropertyIdentifies the RibbonTitle dependency property.
RibbonToggleButtonStylePropertyIdentifies the RibbonToggleButtonStyle dependency property.
RibbonToolBarButtonStylePropertyIdentifies the RibbonToolBarButtonStyle dependency property.
RibbonToolTipStylePropertyIdentifies the RibbonToolTipStyle dependency property.
TabBarVisibilityPropertyIdentifies the TabBarVisibility dependency property.
TitleEffectPropertyIdentifies the TitleEffect dependency property.
TitleStylePropertyIdentifies the TitleStyle dependency property.
WindowBackgroundPropertyIdentifies the WindowBackground dependency property.
WindowBorderBrushPropertyIdentifies the WindowBorderBrush dependency property.
WindowBorderThicknessPropertyIdentifies the WindowBorderThickness dependency property.

Static Methods

GetReturnLastFocus(DependencyObject)Gets the value of the ReturnLastFocus attached property.
SetReturnLastFocus(DependencyObject, bool)Sets the ReturnLastFocus attached property.

Public Methods

AttachEventHandlers()Attach built-in event handlers to control templates. Call this method if necessary.
DetachedEventHandlers()Detach built-in event handlers from control templates. Call this method if necessary.
Dispose()Called when the object is being disposed.
InitializeTemplates()Initializes control templates.
OnApplyTemplate()When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate(). In simplest terms, this means the method is called just before a UI element displays in an application. For more information, see Remarks.

Protected Methods

ClearContainerForItemOverride(DependencyObject, object)Undoes the effects of the System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject,System.Object) method.
GetContainerForItemOverride()Creates or identifies the element that is used to display the given item.
IsItemItsOwnContainerOverride(object)Determines if the specified item is (or is eligible to be) its own container.
MeasureOverride(Size)Provides the behavior for the Measure pass of Silverlight layout. Classes can override this method to define their own Measure pass behavior.
OnGotFocus(RoutedEventArgs) 
OnItemsChanged(NotifyCollectionChangedEventArgs) 
OnItemsSourceChanged(IEnumerable, IEnumerable)Called when the ItemsSource property changes.
PrepareContainerForItemOverride(DependencyObject, object)Prepares the specified element to display the specified item.

Public Constructors

public UXRibbonBar()

Creates a new instance of UXRibbonBar class.

Public Properties

public ObservableCollection<string> ActiveContextualTabs { get; set; }

Gets or sets a value that determines which contextual tabs are active.

public UXRibbonApplicationMenu ApplicationMenu { get; set; }

Gets or sets a value that represents an object instance of UXRibbonApplicationMenu.

public Visibility ApplicationMenuVisibility { get; set; }

Gets or sets a value that indicates whether the application menu is visible.

public bool AutoCreateApplicationMenu { get; set; }

Gets or sets a value indicating whether the application menu should be automatically created eventhough it is not defined.

public bool AutoCreateQuickAccessToolBar { get; set; }

Gets or sets a value indicating whether the quick access toolbar should be automatically created eventhough it is not defined.

public string CloseText { get; set; }

Gets or sets a value that determines the window close tooltip text.

public Collection<UXRibbonContextualTabGroup> ContextualTabGroups { get; }

Gets the collection of contextual tab groups in the ribbon control.

public IEnumerable ContextualTabGroupsSource { get; set; }

Gets or sets a value that represents the items for contextual tab groups.

public ControlBoxPosition ControlBoxPosition { get; set; }

Gets or sets a value that specifies the window control box position.

public Visibility ControlBoxVisibility { get; set; }

Gets or sets a value that determines whether the window control box is visible.

public Visibility ExpandButtonVisibility { get; set; }

Gets or sets a value that indicates whether the expand button is visible.

public double HeaderHeight { get; set; }

Gets or sets a value indicating the height of the header element.

public Visibility HeaderVisibility { get; set; }

Gets or sets a value that indicates whether the header is visible.

public object HelpButtonContent { get; set; }

Gets or sets the content to display in the help button element.

public ContentType HelpButtonDisplayMode { get; set; }

Gets or sets a value that indicates the display mode of the help button element.

public ImageSource HelpButtonIcon { get; set; }

Gets or sets a image source for the help button element.

public Visibility HelpButtonVisibility { get; set; }

Gets or sets a value that indicates whether the help button is visible.

public ICommand HelpCommand { get; set; }

Gets or sets the command to invoke when this button is clicked.

public NoExecuteBehavior HelpCommandCannotExecute { get; set; }

Gets or sets the UI behavior when the associated Command cannot be executed.

public object HelpCommandParameter { get; set; }

Gets or sets the parameter to pass to the Command property.

public UIElement HelpCommandTarget { get; set; }

Gets or sets the element on which to raise the specified command.

public ImageSource Icon { get; set; }

Gets or sets a value that determines the icon of the ribbon control.

public bool IsExpanded { get; set; }

Gets or sets a value indicating whether the ribbon is expanded.

public string MaximizeText { get; set; }

Gets or sets a value that determines the window maximize tooltip text.

public string MinimizeText { get; set; }

Gets or sets a value that determines the window minimize tooltip text.

public double MinRibbonBarHeight { get; set; }

Gets or sets a value that determines the minimum height of the ribbon bar.

public UXRibbonQuickAccessToolBar QuickAccessToolBar { get; set; }

Gets or sets a value that represents an object instance of UXRibbonQuickAccessToolBar.

public string RestoreDownText { get; set; }

Gets or sets a value that determines the window restore down tooltip text.

public Style RibbonButtonStyle { get; set; }

 

public Style RibbonCheckBoxStyle { get; set; }

 

public Style RibbonComboBoxStyle { get; set; }

 

public Style RibbonDropDownButtonStyle { get; set; }

 

public Style RibbonFieldLabelStyle { get; set; }

 

public Style RibbonGalleryListStyle { get; set; }

 

public Style RibbonGalleryStyle { get; set; }

 

public Style RibbonOrderedTabGroupStyle { get; set; }

 

public Style RibbonRadioButtonStyle { get; set; }

 

public Style RibbonSeparatorStyle { get; set; }

 

public Style RibbonSplitButtonStyle { get; set; }

 

public Style RibbonTabGroupStyle { get; set; }

 

public string RibbonTitle { get; set; }

Gets or sets a value that specifies the title of the ribbon control.

public Style RibbonToggleButtonStyle { get; set; }

 

public Style RibbonToolBarButtonStyle { get; set; }

 

public Style RibbonToolTipStyle { get; set; }

Gets or sets the style to apply to the ribbon tooltip.

public Visibility TabBarVisibility { get; set; }

Gets or sets a value indicating whether the tab bar element is visible.

public Effect TitleEffect { get; set; }

Gets or sets a value that specifies the effect of ribbon title.

public Style TitleStyle { get; set; }

Gets or sets the style to apply to the title element.

public Brush WindowBackground { get; set; }

Gets or sets a value that determines the window background.

public Brush WindowBorderBrush { get; set; }

Gets or sets a value that determines the window border brush.

public Thickness WindowBorderThickness { get; set; }

Gets or sets a value that determines the thickness of the window border.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty ActiveContextualTabsProperty

Identifies the ActiveContextualTabs dependency property.

public static readonly DependencyProperty ApplicationMenuProperty

Identifies the ApplicationMenu dependency property.

public static readonly DependencyProperty ApplicationMenuVisibilityProperty

Identifies the ApplicationMenuVisibility dependency property.

public static readonly DependencyProperty AutoCreateApplicationMenuProperty

Identifies the AutoCreateApplicationMenu dependency property.

public static readonly DependencyProperty AutoCreateQuickAccessToolBarProperty

Identifies the AutoCreateQuickAccessToolBar dependency property.

public static readonly DependencyProperty CloseTextProperty

Identifies the CloseText dependency property.

public static readonly DependencyProperty ContextualTabGroupsSourceProperty

Identifies the ContextualTabGroupsSource dependency property.

public static readonly DependencyProperty ControlBoxPositionProperty

Identifies the ControlBoxPosition dependency property.

public static readonly DependencyProperty ControlBoxVisibilityProperty

Identifies the ControlBoxVisibility dependency property.

public static readonly DependencyProperty ExpandButtonVisibilityProperty

Identifies the ExpandButtonVisibility dependency property.

public static readonly DependencyProperty HeaderHeightProperty

Identifies the HeaderHeight dependency property.

public static readonly DependencyProperty HeaderVisibilityProperty

Identifies the HeaderVisibility dependency property.

public static readonly DependencyProperty HelpButtonContentProperty

Identifies the HelpButtonContent dependency property.

public static readonly DependencyProperty HelpButtonDisplayModeProperty

Identifies the HelpButtonDisplayMode dependency property.

public static readonly DependencyProperty HelpButtonIconProperty

Identifies the HelpButtonIcon dependency property.

public static readonly DependencyProperty HelpButtonVisibilityProperty

Identifies the HelpButtonVisibility dependency property.

public static readonly DependencyProperty HelpCommandCannotExecuteProperty

Identifies the HelpCommandCannotExecute dependency property.

public static readonly DependencyProperty HelpCommandParameterProperty

Identifies the HelpCommandParameter dependency property.

public static readonly DependencyProperty HelpCommandProperty

Identifies the HelpCommand dependency property.

public static readonly DependencyProperty HelpCommandTargetProperty

Identifies the HelpCommandTarget dependency property.

public static readonly DependencyProperty IconProperty

Identifies the Icon dependency property.

public static readonly DependencyProperty IsExpandedProperty

Identifies the IsExpanded dependency property.

public static readonly DependencyProperty MaximizeTextProperty

Identifies the MaximizeText dependency property.

public static readonly DependencyProperty MinimizeTextProperty

Identifies the MinimizeText dependency property.

public static readonly DependencyProperty MinRibbonBarHeightProperty

Identifies the MinRibbonBarHeight dependency property.

public static readonly DependencyProperty QuickAccessToolBarProperty

Identifies the QuickAccessToolBar dependency property.

public static readonly DependencyProperty RestoreDownTextProperty

Identifies the RestoreDownText dependency property.

public static readonly DependencyProperty ReturnLastFocusProperty

Identifies the ReturnLastFocus attached property.

public static readonly DependencyProperty RibbonButtonStyleProperty

Identifies the RibbonButtonStyle dependency property.

public static readonly DependencyProperty RibbonCheckBoxStyleProperty

Identifies the RibbonCheckBoxStyle dependency property.

public static readonly DependencyProperty RibbonComboBoxStyleProperty

Identifies the RibbonComboBoxStyle dependency property.

public static readonly DependencyProperty RibbonDropDownButtonStyleProperty

Identifies the RibbonDropDownButtonStyle dependency property.

public static readonly DependencyProperty RibbonFieldLabelStyleProperty

Identifies the RibbonFieldLabelStyle dependency property.

public static readonly DependencyProperty RibbonGalleryListStyleProperty

Identifies the RibbonGalleryListStyle dependency property.

public static readonly DependencyProperty RibbonGalleryStyleProperty

Identifies the RibbonGalleryStyle dependency property.

public static readonly DependencyProperty RibbonOrderedTabGroupStyleProperty

Identifies the RibbonOrderedTabGroupStyle dependency property.

public static readonly DependencyProperty RibbonRadioButtonStyleProperty

Identifies the RibbonRadioButtonStyle dependency property.

public static readonly DependencyProperty RibbonSeparatorStyleProperty

Identifies the RibbonSeparatorStyle dependency property.

public static readonly DependencyProperty RibbonSplitButtonStyleProperty

Identifies the RibbonSplitButtonStyle dependency property.

public static readonly DependencyProperty RibbonTabGroupStyleProperty

Identifies the RibbonTabGroupStyle dependency property.

public static readonly DependencyProperty RibbonTitleProperty

Identifies the RibbonTitle dependency property.

public static readonly DependencyProperty RibbonToggleButtonStyleProperty

Identifies the RibbonToggleButtonStyle dependency property.

public static readonly DependencyProperty RibbonToolBarButtonStyleProperty

Identifies the RibbonToolBarButtonStyle dependency property.

public static readonly DependencyProperty RibbonToolTipStyleProperty

Identifies the RibbonToolTipStyle dependency property.

public static readonly DependencyProperty TabBarVisibilityProperty

Identifies the TabBarVisibility dependency property.

public static readonly DependencyProperty TitleEffectProperty

Identifies the TitleEffect dependency property.

public static readonly DependencyProperty TitleStyleProperty

Identifies the TitleStyle dependency property.

public static readonly DependencyProperty WindowBackgroundProperty

Identifies the WindowBackground dependency property.

public static readonly DependencyProperty WindowBorderBrushProperty

Identifies the WindowBorderBrush dependency property.

public static readonly DependencyProperty WindowBorderThicknessProperty

Identifies the WindowBorderThickness dependency property.

Static Methods

public static bool GetReturnLastFocus(DependencyObject obj)

Gets the value of the ReturnLastFocus attached property.

Parameters

objThe object of which the attached property value will be queried.

Return Types

A boolean value.

 

public static void SetReturnLastFocus(DependencyObject obj, bool value)

Sets the ReturnLastFocus attached property.

Parameters

objThe object of which the attached property will be set to.
valueA boolean value

 

Public Methods

public void AttachEventHandlers()

Attach built-in event handlers to control templates. Call this method if necessary.

public void DetachedEventHandlers()

Detach built-in event handlers from control templates. Call this method if necessary.

public void Dispose()

Called when the object is being disposed.

public void InitializeTemplates()

Initializes control templates.

public void OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate(). In simplest terms, this means the method is called just before a UI element displays in an application. For more information, see Remarks.

Protected Methods

protected void ClearContainerForItemOverride(DependencyObject element, object item)

Undoes the effects of the System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject,System.Object) method.

Parameters

elementThe container element.
itemThe item.

 

protected DependencyObject GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

Return Types

The element that is used to display the given item.

 

protected bool IsItemItsOwnContainerOverride(object item)

Determines if the specified item is (or is eligible to be) its own container.

Parameters

itemThe item to check.

Return Types

true if the item is (or is eligible to be) its own container; otherwise, false.

 

protected Size MeasureOverride(Size availableSize)

Provides the behavior for the Measure pass of Silverlight layout. Classes can override this method to define their own Measure pass behavior.

Parameters

availableSizeThe available size that this object can give to child objects. Infinity (System.Double.PositiveInfinity) can be specified as a value to indicate that the object will size to whatever content is available.

Return Types

The size that this object determines it needs during layout, based on its calculations of the allocated sizes for child objects; or based on other considerations, such as a fixed container size.

 

protected void OnGotFocus(RoutedEventArgs e)

 

Parameters

e 

 

protected void OnItemsChanged(NotifyCollectionChangedEventArgs e)

 

Parameters

e 

 

protected void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)

Called when the ItemsSource property changes.

Parameters

oldValueThe old value of the ItemsSource property.
newValueThe new value of the ItemsSource property.

 

protected void PrepareContainerForItemOverride(DependencyObject element, object item)

Prepares the specified element to display the specified item.

Parameters

elementThe container element used to display the specified item.
itemThe item to display.
  • No labels