Class SimpleMenuButton
Represents a SimpleMenuButton control.
Inheritance
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
public class SimpleMenuButton : ButtonBase, IRibbonControl, IDisposable
Remarks
SimpleMenuButton class represents button control that can be places inside of ApplicationMenu control.
Examples
This example shows how to create a ButtonPanel in XAML.
<ribbon:SimpleMenuButton Label="Mark as Final" Description="Let readers know the document is final and make it read-only" Icon="SampleImages/FinalMark32.png"/>
This example shows how to create a ButtonPanel in C#.
SimpleMenuButton menuButton = new SimpleMenuButton();
menuButton.Description = "Let readers know the document is final and make it read-only";
menuButton.Label= "Mark as Final";
Constructors
SimpleMenuButton()
Declaration
public SimpleMenuButton()
Fields
DescriptionProperty
Defines the description of the SimpleMenuButton. This is a dependency property.
Declaration
public static readonly DependencyProperty DescriptionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IconProperty
Defines the icon that appears in SimpleMenuButton. This is a dependency property.
Declaration
public static readonly DependencyProperty IconProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IconSizeProperty
Defines the iconsize that appears in SimpleMenuButton. This is a dependency property.
Declaration
public static readonly DependencyProperty IconSizeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IconStretchProperty
Declaration
public static readonly DependencyProperty IconStretchProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IconTemplateProperty
Identifies the IconTemplate dependency property.
Declaration
public static readonly DependencyProperty IconTemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the IconTemplate dependency property.
LabelProperty
Defines the text that labels SimpleMenuButton. This is a dependency property.
Declaration
public static readonly DependencyProperty LabelProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SmallIconProperty
Declaration
public static readonly DependencyProperty SmallIconProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
Description
Gets or sets the description of the SimpleMenuButton.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | Type: System.String String value that will be displayed in the SimpleMenuButton. |
Icon
Gets or sets the icon that appears in SimpleMenuButton.
Declaration
public ImageSource Icon { get; set; }
Property Value
Type |
---|
System.Windows.Media.ImageSource |
Remarks
Many controls have more than just text in the element. Often there is an icon.
See Also
IconSize
Gets or sets the size of the icon.
Declaration
public Size IconSize { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Size | The size of the icon. |
IconStretch
Gets or sets value which fills the size of Icon.
Declaration
public Stretch IconStretch { get; set; }
Property Value
Type |
---|
System.Windows.Media.Stretch |
IconTemplate
Gets or sets the template that used to display the icon of SimpleMenuButton.
Declaration
public DataTemplate IconTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.DataTemplate | The System.Windows.DataTemplate that is used to display a icon of SimpleMenuButton. |
Examples
This example shows how to set IconTemplate to SimpleMenuButton.
<sync:SimpleMenuButton >
<sync:SimpleMenuButton.IconTemplate>
<DataTemplate>
<Grid>
<Path
Margin="3,1,0.5,0.5"
Data="M5.5000009,2.500005 L10.500001,2.500005 14.500001,6.500005 14.500001,14.500005 5.5000009,14.500005 z M0,0 L4.0000037,0 4.0000037,12 0,12 z"
Fill="White"
Stretch="Fill" />
<Path
Margin="2,0,0,0"
Data="M9.0000026,11.999999 L13.000003,11.999999 13.000003,12.999999 9.0000026,12.999999 z M9.0000026,9.9999986 L13.000003,9.9999986 13.000003,10.999999 9.0000026,10.999999 z M12,4.7070035 L12,7.0000033 14.293,7.0000033 z M6.9999967,4.0000001 L6.9999967,15 14.999997,15 14.999997,8.0000033 11,8.0000033 11,4.0000001 z M5.9999967,2.9999999 L11.706997,2.9999999 15.999997,7.293 15.999997,16 5.9999967,16 z M0,0 L6.9999967,0 6.9999967,2 5.9999971,2 5.9999971,1 1,1 1,13 4.9999976,13 4.9999976,14 0,14 z"
Fill="#FF3A3939"
Stretch="Fill" />
</Grid>
</DataTemplate>
</sync:SimpleMenuButton.IconTemplate>
</sync:SimpleMenuButton>
Label
Gets or sets the text that labels SimpleMenuButton.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String | Type: System.String Text that labels the SimpleMenuButton. The default is empty string. |
See Also
SmallIcon
Gets or sets the value for small size of the Icon image
Declaration
public ImageSource SmallIcon { get; set; }
Property Value
Type |
---|
System.Windows.Media.ImageSource |
Methods
Dispose()
Dispose all used objects
Declaration
public void Dispose()
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate.
Declaration
public override void OnApplyTemplate()
OnClick()
Raises the System.Windows.Controls.Primitives.ButtonBase.Click routed event.
Declaration
protected override void OnClick()
OnCreateAutomationPeer()
Creates AutomationPeer for ribbon button.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type | Description |
---|---|
System.Windows.Automation.Peers.AutomationPeer | An appropriate SimpleMenuButtonAutomationPeer for this control as part of the WPF infrastructure. |
OnDescriptionChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises DescriptionChanged event.
Declaration
protected virtual void OnDescriptionChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property change details, such as old value and new value. |
OnIconChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises IconChanged event.
Declaration
protected virtual void OnIconChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnIconSizeChanged(DependencyPropertyChangedEventArgs)
Raises the IconSizeChanged event.
Declaration
protected virtual void OnIconSizeChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | The System.Windows.DependencyPropertyChangedEventArgs instance containing the event data. |
OnLabelChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises LabelChanged event.
Declaration
protected virtual void OnLabelChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
OnMouseRightButtonUp(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.UIElement.MouseRightButtonUprouted event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was released. |
OnSmallIconChanged(DependencyPropertyChangedEventArgs)
Updates property value cache and raises LabelChanged event.
Declaration
protected virtual void OnSmallIconChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | Property changes details, such as old value and new value. |
Events
DescriptionChanged
Event that is raised when Description property is changed.
Declaration
public event PropertyChangedCallback DescriptionChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
IconChanged
Event that is raised when Icon property is changed.
Declaration
public event PropertyChangedCallback IconChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
IconSizeChanged
Event that is raised when Iconsize property is changed.
Declaration
public event PropertyChangedCallback IconSizeChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
LabelChanged
Event that is raised when Label property is changed.
Declaration
public event PropertyChangedCallback LabelChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
SmallIconChanged
Event that is raised when SmallIcon property is changed.
Declaration
public event PropertyChangedCallback SmallIconChanged
Event Type
Type |
---|
System.Windows.PropertyChangedCallback |
Explicit Interface Implementations
IRibbonControl.get_ToolTip()
Declaration
object IRibbonControl.get_ToolTip()
Returns
Type |
---|
System.Object |