Class ButtonAdv
Represents the Button Control.
Inheritance
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Shared.Wpf.dll
Syntax
[SkinType(SkinVisualStyle = Skin.VS2010, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/VS2010Style.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2007Black, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/Office2007BlackStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2007Silver, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/Office2007SilverStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2010Blue, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/Office2010BlueStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2010Black, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/Office2010BlackStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2010Silver, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/Office2010SilverStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Blend, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/BlendStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Office2007Blue, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/Office2007BlueStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.ShinyRed, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/ShinyRedStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.ShinyBlue, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/ShinyBlueStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Default, Type = typeof(TileViewControl), XamlResource = "/Syncfusion.Shared.WPF;component/Controls/ButtonControls/Button/Themes/ButtonAdv.xaml")]
[SkinType(SkinVisualStyle = Skin.Metro, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/MetroStyle.xaml")]
[SkinType(SkinVisualStyle = Skin.Transparent, Type = typeof(TileViewControl), XamlResource = "pack://application:,,,/Syncfusion.Shared.Wpf.Classic;component/Controls/ButtonControls/Button/Themes/TransparentStyle.xaml")]
public class ButtonAdv : ButtonBase, ICommandSource, IButtonAdv
Constructors
ButtonAdv()
Initializes a new instance of the ButtonAdv class.
Declaration
public ButtonAdv()
Fields
CornerRadiusProperty
Using a DependencyProperty as the backing store for CornerRadius.
Declaration
public static readonly DependencyProperty CornerRadiusProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IconHeightProperty
Using a DependencyProperty as the backing store for IconHeight.
Declaration
public static readonly DependencyProperty IconHeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IconStretchProperty
Using a DependencyProperty as the backing store for IconStretch.
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.
IconTemplateSelectorProperty
Identifies the IconTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty IconTemplateSelectorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the IconTemplateSelector dependency property.
IconWidthProperty
Using a DependencyProperty as the backing store for IconWidth.
Declaration
public static readonly DependencyProperty IconWidthProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsCancelProperty
Identifies the IsCancel dependency property.
Declaration
public static readonly DependencyProperty IsCancelProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the IsCancel dependency property.
IsCheckableProperty
Using a DependencyProperty as the backing store for IsCheckable.
Declaration
public static readonly DependencyProperty IsCheckableProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsCheckedProperty
Using a DependencyProperty as the backing store for IsChecked.
Declaration
public static readonly DependencyProperty IsCheckedProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
IsDefaultProperty
Identifies the IsDefault dependency property.
Declaration
public static readonly DependencyProperty IsDefaultProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the IsDefault dependency property.
IsMultiLineProperty
Using a DependencyProperty as the backing store for IsMultiLine.
Declaration
public static readonly DependencyProperty IsMultiLineProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LabelProperty
Using a DependencyProperty as the backing store for Label.
Declaration
public static readonly DependencyProperty LabelProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
LargeIconProperty
Using a DependencyProperty as the backing store for LargeIcon.
Declaration
public static readonly DependencyProperty LargeIconProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SizeModeProperty
Using a DependencyProperty as the backing store for SizeMode.
Declaration
public static readonly DependencyProperty SizeModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SmallIconProperty
Using a DependencyProperty as the backing store for SmallIcon.
Declaration
public static readonly DependencyProperty SmallIconProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
CornerRadius
Gets or sets the corner radius of the button.
Declaration
public CornerRadius CornerRadius { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.CornerRadius | The corner radius applied to the button's corners. The default value is 3. |
IconHeight
Gets or Sets the IconHeight.
Declaration
public double IconHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The Icon Height for button. The default value is 0. |
IconStretch
Gets or sets the fill customization for icon
Declaration
public Stretch IconStretch { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Stretch | The fill customization for icon. The default value is System.Windows.Media.Stretch.Uniform. |
IconTemplate
Gets or sets the template that used to display the icon of ButtonAdv.
Declaration
public DataTemplate IconTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.DataTemplate | The System.Windows.DataTemplate is used to display an icon in ButtonAdv. |
Remarks
IconTemplate inherits its parent DataContext. ButtonAdv exposes IconTemplateSelector, IconTemplate, LargeIcon, SmallIcon properties for setting the Icon. It loads icon in the following priority order,
IconTemplateSelector
Gets or sets a System.Windows.Controls.DataTemplateSelector that determines the template to use to display icon in a ButtonAdv based on SizeMode.
Declaration
public DataTemplateSelector IconTemplateSelector { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Controls.DataTemplateSelector | A custom System.Windows.Controls.DataTemplateSelector selector object that provides logic to choose a System.Windows.DataTemplate to be returned. The default is null. |
Remarks
ButtonAdv exposes IconTemplateSelector, IconTemplate, LargeIcon, SmallIcon properties for setting the Icon. It loads icon in the following priority order,
IconWidth
Gets or Sets the icon width.
Declaration
public double IconWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The Icon Width for button. The default value is 0. |
IsCancel
Gets or sets a value indicates whether the ButtonAdv is cancel button
Declaration
public bool IsCancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true, if the ButtonAdv is a cancel button; otherwise, false. The default is false. |
Remarks
A user can activate the cancel button by pressing the ESC key. When esc key is pressed, the button is focused and click event is raised.
IsCheckable
Gets or sets a value indicating whether this instance can be checkable.
Declaration
public bool IsCheckable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsChecked
Gets or sets a value indicating whether this instance is checked.
Declaration
public bool IsChecked { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
This property is valid only if IsCheckable property is set to true.
IsDefault
Gets or sets a value indicates whether the ButtonAdv is default button.
Declaration
public bool IsDefault { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true, if the ButtonAdv is a default button; otherwise, false. The default value is false. |
Remarks
A user can activate the default button by pressing the Enter key. When enter key is pressed, the button is focused and click event is raised.
IsMultiLine
Gets or sets a value indicating whether this instance can have multi-line text.
Declaration
public bool IsMultiLine { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Label
Gets or sets the text content for button.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String | The text content for button. The default value is Button. |
LargeIcon
Gets or sets the large icon.
Declaration
public ImageSource LargeIcon { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.ImageSource | The large icon for button. The default value is null. |
SizeMode
Gets or sets the size mode.
Declaration
public SizeMode SizeMode { get; set; }
Property Value
Type | Description |
---|---|
SizeMode | The size mode for button. The default value is Normal. |
SmallIcon
Gets or sets the small icon.
Declaration
public ImageSource SmallIcon { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.ImageSource | The small icon for Button. The default value is null. |
Methods
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.
Declaration
public override void OnApplyTemplate()
OnClick()
Raises the System.Windows.Controls.Primitives.ButtonBase.Click event.
Declaration
protected override void OnClick()
OnCreateAutomationPeer()
Automation of ButtonAdv control
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type |
---|
System.Windows.Automation.Peers.AutomationPeer |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled System.Windows.Element.MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseLeftButtonDown(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 left mouse button was pressed. |
UpdateSize()
Method to update the button control structure according to the size modes
Declaration
public void UpdateSize()
Events
Checked
Occurs when button is [checked].
Declaration
public event RoutedEventHandler Checked
Event Type
Type |
---|
System.Windows.RoutedEventHandler |