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.
The following figure shows the results of the example above.
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.
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.
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.
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.
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
ActiveContextualTabs | Gets or sets a value that determines which contextual tabs are active. |
ApplicationMenu | Gets or sets a value that represents an object instance of UXRibbonApplicationMenu. |
ApplicationMenuVisibility | Gets or sets a value that indicates whether the application menu is visible. |
AutoCreateApplicationMenu | Gets or sets a value indicating whether the application menu should be automatically created eventhough it is not defined. |
AutoCreateQuickAccessToolBar | Gets or sets a value indicating whether the quick access toolbar should be automatically created eventhough it is not defined. |
CloseText | Gets or sets a value that determines the window close tooltip text. |
ContextualTabGroups | Gets the collection of contextual tab groups in the ribbon control. |
ContextualTabGroupsSource | Gets or sets a value that represents the items for contextual tab groups. |
ControlBoxPosition | Gets or sets a value that specifies the window control box position. |
ControlBoxVisibility | Gets or sets a value that determines whether the window control box is visible. |
ExpandButtonVisibility | Gets or sets a value that indicates whether the expand button is visible. |
HeaderHeight | Gets or sets a value indicating the height of the header element. |
HeaderVisibility | Gets or sets a value that indicates whether the header is visible. |
HelpButtonContent | Gets or sets the content to display in the help button element. |
HelpButtonDisplayMode | Gets or sets a value that indicates the display mode of the help button element. |
HelpButtonIcon | Gets or sets a image source for the help button element. |
HelpButtonVisibility | Gets or sets a value that indicates whether the help button is visible. |
HelpCommand | Gets or sets the command to invoke when this button is clicked. |
HelpCommandCannotExecute | Gets or sets the UI behavior when the associated Command cannot be executed. |
HelpCommandParameter | Gets or sets the parameter to pass to the Command property. |
HelpCommandTarget | Gets or sets the element on which to raise the specified command. |
Icon | Gets or sets a value that determines the icon of the ribbon control. |
IsExpanded | Gets or sets a value indicating whether the ribbon is expanded. |
MaximizeText | Gets or sets a value that determines the window maximize tooltip text. |
MinimizeText | Gets or sets a value that determines the window minimize tooltip text. |
MinRibbonBarHeight | Gets or sets a value that determines the minimum height of the ribbon bar. |
QuickAccessToolBar | Gets or sets a value that represents an object instance of UXRibbonQuickAccessToolBar. |
RestoreDownText | Gets or sets a value that determines the window restore down tooltip text. |
RibbonButtonStyle | |
RibbonCheckBoxStyle | |
RibbonComboBoxStyle | |
RibbonDropDownButtonStyle | |
RibbonFieldLabelStyle | |
RibbonGalleryListStyle | |
RibbonGalleryStyle | |
RibbonOrderedTabGroupStyle | |
RibbonRadioButtonStyle | |
RibbonSeparatorStyle | |
RibbonSplitButtonStyle | |
RibbonTabGroupStyle | |
RibbonTitle | Gets or sets a value that specifies the title of the ribbon control. |
RibbonToggleButtonStyle | |
RibbonToolBarButtonStyle | |
RibbonToolTipStyle | Gets or sets the style to apply to the ribbon tooltip. |
TabBarVisibility | Gets or sets a value indicating whether the tab bar element is visible. |
TitleEffect | Gets or sets a value that specifies the effect of ribbon title. |
TitleStyle | Gets or sets the style to apply to the title element. |
WindowBackground | Gets or sets a value that determines the window background. |
WindowBorderBrush | Gets or sets a value that determines the window border brush. |
WindowBorderThickness | Gets or sets a value that determines the thickness of the window border. |
Protected Properties
Product | Product Info. |
Fields
ActiveContextualTabsProperty | Identifies the ActiveContextualTabs dependency property. |
ApplicationMenuProperty | Identifies the ApplicationMenu dependency property. |
ApplicationMenuVisibilityProperty | Identifies the ApplicationMenuVisibility dependency property. |
AutoCreateApplicationMenuProperty | Identifies the AutoCreateApplicationMenu dependency property. |
AutoCreateQuickAccessToolBarProperty | Identifies the AutoCreateQuickAccessToolBar dependency property. |
CloseTextProperty | Identifies the CloseText dependency property. |
ContextualTabGroupsSourceProperty | Identifies the ContextualTabGroupsSource dependency property. |
ControlBoxPositionProperty | Identifies the ControlBoxPosition dependency property. |
ControlBoxVisibilityProperty | Identifies the ControlBoxVisibility dependency property. |
ExpandButtonVisibilityProperty | Identifies the ExpandButtonVisibility dependency property. |
HeaderHeightProperty | Identifies the HeaderHeight dependency property. |
HeaderVisibilityProperty | Identifies the HeaderVisibility dependency property. |
HelpButtonContentProperty | Identifies the HelpButtonContent dependency property. |
HelpButtonDisplayModeProperty | Identifies the HelpButtonDisplayMode dependency property. |
HelpButtonIconProperty | Identifies the HelpButtonIcon dependency property. |
HelpButtonVisibilityProperty | Identifies the HelpButtonVisibility dependency property. |
HelpCommandCannotExecuteProperty | Identifies the HelpCommandCannotExecute dependency property. |
HelpCommandParameterProperty | Identifies the HelpCommandParameter dependency property. |
HelpCommandProperty | Identifies the HelpCommand dependency property. |
HelpCommandTargetProperty | Identifies the HelpCommandTarget dependency property. |
IconProperty | Identifies the Icon dependency property. |
IsExpandedProperty | Identifies the IsExpanded dependency property. |
MaximizeTextProperty | Identifies the MaximizeText dependency property. |
MinimizeTextProperty | Identifies the MinimizeText dependency property. |
MinRibbonBarHeightProperty | Identifies the MinRibbonBarHeight dependency property. |
QuickAccessToolBarProperty | Identifies the QuickAccessToolBar dependency property. |
RestoreDownTextProperty | Identifies the RestoreDownText dependency property. |
ReturnLastFocusProperty | Identifies the ReturnLastFocus attached property. |
RibbonButtonStyleProperty | Identifies the RibbonButtonStyle dependency property. |
RibbonCheckBoxStyleProperty | Identifies the RibbonCheckBoxStyle dependency property. |
RibbonComboBoxStyleProperty | Identifies the RibbonComboBoxStyle dependency property. |
RibbonDropDownButtonStyleProperty | Identifies the RibbonDropDownButtonStyle dependency property. |
RibbonFieldLabelStyleProperty | Identifies the RibbonFieldLabelStyle dependency property. |
RibbonGalleryListStyleProperty | Identifies the RibbonGalleryListStyle dependency property. |
RibbonGalleryStyleProperty | Identifies the RibbonGalleryStyle dependency property. |
RibbonOrderedTabGroupStyleProperty | Identifies the RibbonOrderedTabGroupStyle dependency property. |
RibbonRadioButtonStyleProperty | Identifies the RibbonRadioButtonStyle dependency property. |
RibbonSeparatorStyleProperty | Identifies the RibbonSeparatorStyle dependency property. |
RibbonSplitButtonStyleProperty | Identifies the RibbonSplitButtonStyle dependency property. |
RibbonTabGroupStyleProperty | Identifies the RibbonTabGroupStyle dependency property. |
RibbonTitleProperty | Identifies the RibbonTitle dependency property. |
RibbonToggleButtonStyleProperty | Identifies the RibbonToggleButtonStyle dependency property. |
RibbonToolBarButtonStyleProperty | Identifies the RibbonToolBarButtonStyle dependency property. |
RibbonToolTipStyleProperty | Identifies the RibbonToolTipStyle dependency property. |
TabBarVisibilityProperty | Identifies the TabBarVisibility dependency property. |
TitleEffectProperty | Identifies the TitleEffect dependency property. |
TitleStyleProperty | Identifies the TitleStyle dependency property. |
WindowBackgroundProperty | Identifies the WindowBackground dependency property. |
WindowBorderBrushProperty | Identifies the WindowBorderBrush dependency property. |
WindowBorderThicknessProperty | Identifies 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
obj | The 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
obj | The object of which the attached property will be set to. |
value | A 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
element | The container element. |
item | The 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
item | The 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
availableSize | The 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
oldValue | The old value of the ItemsSource property. |
newValue | The new value of the ItemsSource property. |
protected void PrepareContainerForItemOverride(DependencyObject element, object item)
Prepares the specified element to display the specified item.
Parameters
element | The container element used to display the specified item. |
item | The item to display. |