Intersoft.Client.UI.Aqua Namespace : UXButton Class |
<TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)> <TemplatePartAttribute(Name="AnimationElement", Type=System.Windows.Controls.Border)> <TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)> <TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)> <TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)> <TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)> <TemplateVisualStateAttribute(Name="KeyboardFocused", GroupName="KeyboardFocusStates")> <TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)> <TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")> <TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")> <DescriptionAttribute("Represents a command button control with various display mode, keyboard support and routed command.")> <TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")> <TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")> <TemplateVisualStateAttribute(GroupName="CommonStates", Name="HighlightFocused")> <TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")> <TemplateVisualStateAttribute(GroupName="FocusStates", Name="Focused")> <TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")> <TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)> <TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")> <TemplatePartAttribute(Name="StylishLabel", Type=Intersoft.Client.UI.Controls.StylishLabel)> <TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)> Public Class UXButton Inherits Intersoft.Client.Framework.ISButton Implements Intersoft.Client.Framework.IControl, Intersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, Intersoft.Client.Framework.INavigationSource, Intersoft.Client.Framework.INavigationSupport, Intersoft.Client.Framework.Input.ICommandSource, Intersoft.Client.Framework.Input.IKeyboardFocus
Dim instance As UXButton
[TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="AnimationElement", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)] [TemplateVisualStateAttribute(Name="KeyboardFocused", GroupName="KeyboardFocusStates")] [TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)] [TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")] [DescriptionAttribute("Represents a command button control with various display mode, keyboard support and routed command.")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="HighlightFocused")] [TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")] [TemplateVisualStateAttribute(GroupName="FocusStates", Name="Focused")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")] [TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")] [TemplatePartAttribute(Name="StylishLabel", Type=Intersoft.Client.UI.Controls.StylishLabel)] [TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)] public class UXButton : Intersoft.Client.Framework.ISButton, Intersoft.Client.Framework.IControl, Intersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, Intersoft.Client.Framework.INavigationSource, Intersoft.Client.Framework.INavigationSupport, Intersoft.Client.Framework.Input.ICommandSource, Intersoft.Client.Framework.Input.IKeyboardFocus
[TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="AnimationElement", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)] [TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)] [TemplateVisualStateAttribute(Name="KeyboardFocused", GroupName="KeyboardFocusStates")] [TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)] [TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")] [DescriptionAttribute("Represents a command button control with various display mode, keyboard support and routed command.")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="HighlightFocused")] [TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")] [TemplateVisualStateAttribute(GroupName="FocusStates", Name="Focused")] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")] [TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)] [TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")] [TemplatePartAttribute(Name="StylishLabel", Type=Intersoft.Client.UI.Controls.StylishLabel)] [TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)] public ref class UXButton : public Intersoft.Client.Framework.ISButton, Intersoft.Client.Framework.IControl, Intersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, Intersoft.Client.Framework.INavigationSource, Intersoft.Client.Framework.INavigationSupport, Intersoft.Client.Framework.Input.ICommandSource, Intersoft.Client.Framework.Input.IKeyboardFocus
UXButton is primarily used to represent a command in a user interface application. Typical example of commands that are commonly found in an application are Save, OK and Cancel button. UXButton is a fundamental UI control that generally consisted of a visual interface and a text that users can click to execute the command associated to the button. Alternatively, users can press Enter key or Spacebar key to execute the command when the button has focus.
The primary function of UXButton is a command button which represents an action that will be executed when the button is clicked.
The following example shows how to define a simple UXButton using XAML.
XAML |
Copy Code
|
---|---|
<Intersoft:UXButton Content="Save" Width="90"/> |
The simplest way to respond to a button click is by handling its Click event. You add the Click handler in the XAML and write the logic in code to respond the Click event such as shown in the following example:
XAML |
Copy Code
|
---|---|
<Intersoft:UXButton Content="Save" Width="90" Click="SaveButton_Clicked"/> |
C# |
Copy Code
|
---|---|
private void SampleControl1_Click(object sender, RoutedEventArgs e) { MessageBox.Show("You clicked Save button!"); } |
UXButton implements ICommandSource interface which exposes Command, CommandParameter and CommandTarget property. You can assign a command to a UXButton by setting its Command property to the target command existed in your application. With commanding, you can separate the actual logic of the command from the command definition, which is ideal for MVVM pattern application. To learn about MVVM pattern, see MVVM Pattern Overview.
The following example shows how to assign a Copy command to a UXButton.
XAML |
Copy Code
|
---|---|
<Intersoft:UXButton Content="Copy" Width="90" Click="local:EditingCommands.Copy"/> |
For more information on how to implement routed command in your application, see How-to: Implement a RoutedCommand. For more information about the basics of commanding concept, see Commanding Overview.
In addition to command button, you can also use UXButton as a toggle button, group button, or a navigation button. To learn more about UXButton features, see UXButton Overview.
System.Object
System.Windows.DependencyObject
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
System.Windows.Controls.ContentControl
System.Windows.Controls.Primitives.ButtonBase
System.Windows.Controls.Button
Intersoft.Client.Framework.ISButton
Intersoft.Client.UI.Aqua.UXButton
Intersoft.Client.UI.Aqua.UXButtonItems
Intersoft.Client.UI.Aqua.UXFlatButton
Intersoft.Client.UI.Aqua.UXInput.UXCalendarButton
Intersoft.Client.UI.Aqua.UXInput.UXCalendarDayName
Intersoft.Client.UI.Aqua.UXInput.UXCalendarWeekNumber
Intersoft.Client.UI.Aqua.UXNavigationButton
Intersoft.Client.UI.Aqua.UXRepeatButton
Intersoft.Client.UI.Aqua.UXRibbon.UXRibbonButton
Intersoft.Client.UI.Aqua.UXToggleButton
Intersoft.Client.UI.ScheduleView.UXScheduleViewNavigationButton
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2