Intersoft ClientUI Documentation
UXButton Class
Members  See Also  Send Feedback
Intersoft.Client.UI.Aqua Namespace : UXButton Class






Represents a command button control with various display mode, keyboard support and routed command.

Object Model

UXButton Class

Syntax

Visual Basic (Declaration) 
<TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)>
<DescriptionAttribute("Represents a command button control with various display mode, keyboard support and routed command.")>
<TemplateVisualStateAttribute(Name="Focused", GroupName="FocusStates")>
<TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)>
<TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")>
<TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")>
<TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)>
<TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")>
<TemplatePartAttribute(Name="StylishLabel", Type=Intersoft.Client.UI.Controls.StylishLabel)>
<TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")>
<TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="HighlightFocused")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")>
<TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)>
<TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)>
<TemplatePartAttribute(Name="AnimationElement", Type=System.Windows.Controls.Border)>
<TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)>
Public Class UXButton 
   Inherits Intersoft.Client.Framework.ISButton
   Implements IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus 
Visual Basic (Usage)Copy Code
Dim instance As UXButton
C# 
[TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)]
[DescriptionAttribute("Represents a command button control with various display mode, keyboard support and routed command.")]
[TemplateVisualStateAttribute(Name="Focused", GroupName="FocusStates")]
[TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")]
[TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")]
[TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")]
[TemplatePartAttribute(Name="StylishLabel", Type=Intersoft.Client.UI.Controls.StylishLabel)]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")]
[TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="HighlightFocused")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="AnimationElement", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)]
public class UXButton : Intersoft.Client.Framework.ISButton, IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus  
JScript 
TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)
DescriptionAttribute("Represents a command button control with various display mode, keyboard support and routed command.")
TemplateVisualStateAttribute(Name="Focused", GroupName="FocusStates")
TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)
TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)
TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")
TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")
TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)
TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")
TemplatePartAttribute(Name="StylishLabel", Type=Intersoft.Client.UI.Controls.StylishLabel)
TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")
TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)
TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")
TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")
TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")
TemplateVisualStateAttribute(GroupName="CommonStates", Name="HighlightFocused")
TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")
TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)
TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)
TemplatePartAttribute(Name="AnimationElement", Type=System.Windows.Controls.Border)
TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)
public class UXButton extends Intersoft.Client.Framework.ISButton implements IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus 
Managed Extensions for C++ 
[TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)]
[DescriptionAttribute("Represents a command button control with various display mode, keyboard support and routed command.")]
[TemplateVisualStateAttribute(Name="Focused", GroupName="FocusStates")]
[TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")]
[TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")]
[TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")]
[TemplatePartAttribute(Name="StylishLabel", Type=Intersoft.Client.UI.Controls.StylishLabel)]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")]
[TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="HighlightFocused")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="AnimationElement", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)]
public __gc class UXButton : public Intersoft.Client.Framework.ISButton, IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus  
C++/CLI 
[TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)]
[DescriptionAttribute("Represents a command button control with various display mode, keyboard support and routed command.")]
[TemplateVisualStateAttribute(Name="Focused", GroupName="FocusStates")]
[TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")]
[TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")]
[TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")]
[TemplatePartAttribute(Name="StylishLabel", Type=Intersoft.Client.UI.Controls.StylishLabel)]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")]
[TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="HighlightFocused")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="AnimationElement", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)]
public ref class UXButton : public Intersoft.Client.Framework.ISButton, IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus  

Remarks

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.

Inheritance Hierarchy

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

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.