Skip to end of metadata
Go to start of metadata

Remarks

Derived from UXButton, UXRibbonButton is a command button which represents an action that will be executed when the button is clicked. To learn more about UXButton, see UXButton Overview.

XAML

The result looks like the following figure.

To learn more about ribbon controls, see Working with Ribbon Controls.

Definition

public class UXRibbonButton : UXButton,

IRibbonKeyTipAction, IRibbonControl

Summary

The following table summarizes the members exposed in this class.

Public Constructors

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

Public Properties

FirstRowContentGets or sets the text content for the first row.
LargeIconGets or sets a value that specifies the control large icon.
LargeImageHeightGets or sets a value that specifies the large image height.
LargeImageWidthGets or sets a value that specifies the large image width.
MaximumSizeGets or sets a value that specifies the control maximum size.
MaxLargeButtonWidthGets or sets a value that specifies the maximum width of the button when the Size property is Large.
MinimumSizeGets or sets a value that specifies the control minimum size.
MinLargeButtonWidthGets or sets a value that specifies the minimum width of the button when the Size property is Large.
SecondRowContentGets or sets the text content for the alternating row.
SizeGets or sets a value that specifies the control size.
TextLineHeightGets or sets a value that indicates the line height of the button's text.

Fields

FirstRowContentPropertyIdentifies the FirstRowContent dependency property.
LargeIconPropertyIdentifies the LargeIcon dependency property.
LargeImageHeightPropertyIdentifies the LargeImageHeight dependency property.
LargeImageWidthPropertyIdentifies the LargeImageWidth dependency property.
MaximumSizePropertyIdentifies the MaximumSize dependency property.
MaxLargeButtonWidthPropertyIdentifies the MaxLargeButtonWidth dependency property.
MinimumSizePropertyIdentifies the MinimumSize dependency property.
MinLargeButtonWidthPropertyIdentifies the MaxLargeButtonWidth dependency property.
SecondRowContentPropertyIdentifies the SecondRowContent dependency property.
SizePropertyIdentifies the Size dependency property.
TextLineHeightPropertyIdentifies the TextLineHeight dependency property.

Public Methods

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.
RaiseAction()Raise the action in element that implements IRibbonKeyTipAction.

Protected Methods

ChangeVisualState(bool)Change visual state.
GoToLargeState(bool)Active the large visual state.
GoToLargeState()Active the large visual state.
GoToMediumState(bool)Active the medium visual state.
GoToMediumState()Active the medium visual state.
GoToSmallState(bool)Active the small visual state.
GoToSmallState()Active the small visual state.
OnClick() 
OnContentChanged(object, object)Called when the value of the Content property changes.

Public Constructors

public UXRibbonButton()

Creates a new instance of UXRibbonButton class.

Public Properties

public string FirstRowContent { get; set; }

Gets or sets the text content for the first row.

public ImageSource LargeIcon { get; set; }

Gets or sets a value that specifies the control large icon.

public double LargeImageHeight { get; set; }

Gets or sets a value that specifies the large image height.

public double LargeImageWidth { get; set; }

Gets or sets a value that specifies the large image width.

public RibbonControlSize MaximumSize { get; set; }

Gets or sets a value that specifies the control maximum size.

public double MaxLargeButtonWidth { get; set; }

Gets or sets a value that specifies the maximum width of the button when the Size property is Large.

public RibbonControlSize MinimumSize { get; set; }

Gets or sets a value that specifies the control minimum size.

public double MinLargeButtonWidth { get; set; }

Gets or sets a value that specifies the minimum width of the button when the Size property is Large.

public string SecondRowContent { get; set; }

Gets or sets the text content for the alternating row.

public RibbonControlSize Size { get; set; }

Gets or sets a value that specifies the control size.

public double TextLineHeight { get; set; }

Gets or sets a value that indicates the line height of the button's text.

Fields

public static readonly DependencyProperty FirstRowContentProperty

Identifies the FirstRowContent dependency property.

public static readonly DependencyProperty LargeIconProperty

Identifies the LargeIcon dependency property.

public static readonly DependencyProperty LargeImageHeightProperty

Identifies the LargeImageHeight dependency property.

public static readonly DependencyProperty LargeImageWidthProperty

Identifies the LargeImageWidth dependency property.

public static readonly DependencyProperty MaximumSizeProperty

Identifies the MaximumSize dependency property.

public static readonly DependencyProperty MaxLargeButtonWidthProperty

Identifies the MaxLargeButtonWidth dependency property.

public static readonly DependencyProperty MinimumSizeProperty

Identifies the MinimumSize dependency property.

public static readonly DependencyProperty MinLargeButtonWidthProperty

Identifies the MaxLargeButtonWidth dependency property.

public static readonly DependencyProperty SecondRowContentProperty

Identifies the SecondRowContent dependency property.

public static readonly DependencyProperty SizeProperty

Identifies the Size dependency property.

public static readonly DependencyProperty TextLineHeightProperty

Identifies the TextLineHeight dependency property.

Public Methods

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.

public void RaiseAction()

Raise the action in element that implements IRibbonKeyTipAction.

Protected Methods

protected void ChangeVisualState(bool useTransitions)

Change visual state.

Parameters

useTransitions 

 

protected void GoToLargeState(bool animate)

Active the large visual state.

Parameters

animate 

 

protected void GoToLargeState()

Active the large visual state.

protected void GoToMediumState(bool animate)

Active the medium visual state.

Parameters

animate 

 

protected void GoToMediumState()

Active the medium visual state.

protected void GoToSmallState(bool animate)

Active the small visual state.

Parameters

animate 

 

protected void GoToSmallState()

Active the small visual state.

protected void OnClick()

 

protected void OnContentChanged(object oldContent, object newContent)

Called when the value of the Content property changes.

Parameters

oldContentThe old value of the Content property.
newContentThe new value of the Content property.
  • No labels