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






Represents a button control that can be hosted in ToolBar or ToolGroup. Supports various display mode and button type for easy configuration.

Object Model

UXToolBarButton Class

Syntax

Visual Basic (Declaration) 
<TemplatePartAttribute(Name="ContentPresenter", Type=Intersoft.Client.UI.Controls.StylishLabel)>
<TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)>
<TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)>
<TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)>
<TemplateVisualStateAttribute(Name="SplitButtonPressed", GroupName="CommonStates")>
<TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)>
<TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="Button")>
<TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")>
<TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")>
<TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)>
<TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")>
<TemplatePartAttribute(Name="SplitElement", Type=System.Windows.Controls.Grid)>
<DescriptionAttribute("Represents a button control that can be hosted in ToolBar or ToolGroup. Supports various display mode and button type for easy configuration.")>
<TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="DropdownButton")>
<TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")>
<TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)>
<ContentPropertyAttribute("Items")>
<StyleTypedPropertyAttribute(Property="ItemContainerStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXMenuItem)>
<TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="SplitButton")>
Public Class UXToolBarButton 
   Inherits UXSplitButton
   Implements IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus 
Visual Basic (Usage)Copy Code
Dim instance As UXToolBarButton
C# 
[TemplatePartAttribute(Name="ContentPresenter", Type=Intersoft.Client.UI.Controls.StylishLabel)]
[TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[TemplateVisualStateAttribute(Name="SplitButtonPressed", GroupName="CommonStates")]
[TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="Button")]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")]
[TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")]
[TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)]
[TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")]
[TemplatePartAttribute(Name="SplitElement", Type=System.Windows.Controls.Grid)]
[DescriptionAttribute("Represents a button control that can be hosted in ToolBar or ToolGroup. Supports various display mode and button type for easy configuration.")]
[TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="DropdownButton")]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")]
[TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)]
[ContentPropertyAttribute("Items")]
[StyleTypedPropertyAttribute(Property="ItemContainerStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXMenuItem)]
[TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="SplitButton")]
public class UXToolBarButton : UXSplitButton, IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus  
Delphi 
public class UXToolBarButton = class(UXSplitButton, IControl, IFramework, ILicensing, INavigationSource, INavigationSupport, ICommandSource, IKeyboardFocus)
JScript 
TemplatePartAttribute(Name="ContentPresenter", Type=Intersoft.Client.UI.Controls.StylishLabel)
TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)
TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)
TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)
TemplateVisualStateAttribute(Name="SplitButtonPressed", GroupName="CommonStates")
TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)
TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="Button")
TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")
TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)
TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")
TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")
TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")
TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")
TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)
TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)
TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")
TemplatePartAttribute(Name="SplitElement", Type=System.Windows.Controls.Grid)
DescriptionAttribute("Represents a button control that can be hosted in ToolBar or ToolGroup. Supports various display mode and button type for easy configuration.")
TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="DropdownButton")
TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")
TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)
ContentPropertyAttribute("Items")
StyleTypedPropertyAttribute(Property="ItemContainerStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXMenuItem)
TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="SplitButton")
public class UXToolBarButton extends UXSplitButton implements IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus 
Managed Extensions for C++ 
[TemplatePartAttribute(Name="ContentPresenter", Type=Intersoft.Client.UI.Controls.StylishLabel)]
[TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[TemplateVisualStateAttribute(Name="SplitButtonPressed", GroupName="CommonStates")]
[TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="Button")]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")]
[TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")]
[TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)]
[TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")]
[TemplatePartAttribute(Name="SplitElement", Type=System.Windows.Controls.Grid)]
[DescriptionAttribute("Represents a button control that can be hosted in ToolBar or ToolGroup. Supports various display mode and button type for easy configuration.")]
[TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="DropdownButton")]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")]
[TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)]
[ContentPropertyAttribute("Items")]
[StyleTypedPropertyAttribute(Property="ItemContainerStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXMenuItem)]
[TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="SplitButton")]
public __gc class UXToolBarButton : public UXSplitButton, IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus  
C++/CLI 
[TemplatePartAttribute(Name="ContentPresenter", Type=Intersoft.Client.UI.Controls.StylishLabel)]
[TemplatePartAttribute(Name="Background", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="Glass", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[TemplateVisualStateAttribute(Name="SplitButtonPressed", GroupName="CommonStates")]
[TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="Button")]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardUnfocused")]
[TemplatePartAttribute(Name="InnerBorder", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Disabled")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")]
[TemplatePartAttribute(Name="KeyboardFocus", Type=System.Windows.Shapes.Rectangle)]
[TemplatePartAttribute(Name="OuterBorder", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")]
[TemplatePartAttribute(Name="SplitElement", Type=System.Windows.Controls.Grid)]
[DescriptionAttribute("Represents a button control that can be hosted in ToolBar or ToolGroup. Supports various display mode and button type for easy configuration.")]
[TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="DropdownButton")]
[TemplateVisualStateAttribute(GroupName="KeyboardFocusStates", Name="KeyboardFocused")]
[TemplatePartAttribute(Name="FocusVisualElement", Type=System.Windows.Controls.Border)]
[ContentPropertyAttribute("Items")]
[StyleTypedPropertyAttribute(Property="ItemContainerStyle", StyleTargetType=Intersoft.Client.UI.Aqua.UXMenuItem)]
[TemplateVisualStateAttribute(GroupName="DisplayTypeStates", Name="SplitButton")]
public ref class UXToolBarButton : public UXSplitButton, IControlIFramework, ILicensing, INavigationSourceINavigationSupportICommandSourceIKeyboardFocus  

Remarks

UXToolBarButton implements a hybrid content model that exposes both Button and ItemsControl characteristic. This allows for more solid button architecture that streamlines various type of buttons into a single definition, which makes UI development much easier and more efficient. To learn more about this content model, see Content Model Overview.
Commanding, MVVM and Navigation Support

Since UXToolBarButton implements Button model,  it exposes many of the features available in UXButton, such as ImageContent presentation model, default and cancel button, dialog result, commanding, MVVM pattern, navigation, and more. To learn about the common features of the button, see UXButton Overview.

Built-in Button Types

As the result of the hybrid content model implementation, UXToolBarButton provides four types of button that you can apply through ButtonType property, such as discussed in the following.

  • Button
    Represents a standard command button.
     
  • DropdownButton
    Represents a button that displays dropdown menu when clicked, which can contain a collection of menu items and nested menu items similar to UXContextMenu.
     
  • SplitButton
    Represents a combination of command button and a dropdown menu. This type of button typically provides users with a default command that executed when the command part of the button is clicked, while at the same time allowing users to choose alternative commands through the dropdown arrow. Similar to the DropdownButton, you can also define a collection of menu items and nested menu items as in UXContextMenu.
     
  • Custom
    Represents a custom button that can be used to contain any UIElement or controls. With this type, the default layout properties such as margin and padding as well as the UI behaviors would be disabled. Consequently, this type is ideal to host custom controls such as text box, combo box, date picker and others.
     

The following example shows how to create a UXToolBar that contains several buttons that use Button, DropdownButton, SplitButton and Custom type.

XAML Copy Code
 <Intersoft:UXToolBar>

     <Intersoft:UXToolGroup>

         <Intersoft:UXToolBarButton Content="Save Changes" 
                                    DisplayMode="ContentAndImage" 
                                    Icon="/Assets/Images/Commands/Save.png"
                                    Command="{Binding Path=SaveCommand}" />

         <Intersoft:UXToolBarButton Content="Cancel" 
                                    DisplayMode="ContentAndImage" 
                                    Icon="/Assets/Images/Commands/Cancel.png"/>

        <Intersoft:UXToolBarButton ButtonType="Custom">
            <Intersoft:UXToolBarButton.Content>
                <Intersoft:UXComboBox Width="120" />
            </Intersoft:UXToolBarButton.Content>
        </Intersoft:UXToolBarButton>

     </Intersoft:UXToolGroup>

     <Intersoft:UXToolGroup Placement="RightOrBottom">

         <Intersoft:UXToolBarButton ButtonType="SplitButton" 
                                    Content="Send Email" 
                                    DisplayMode="ContentAndImage" 
                                    Icon="/Assets/Images/Commands/NewMessage.png">

             <Intersoft:UXMenuItem Header="Send via Gmail" Icon="/Assets/Images/Commands/Gmail.png" />
             <Intersoft:UXMenuItem Header="Send via Facebook" Icon="/Assets/Images/Commands/Facebook16.png" />

         </Intersoft:UXToolBarButton>

         <Intersoft:UXSeparator/>

         <Intersoft:UXToolBarButton Content="More Actions" 
                                    ButtonType="DropdownButton">
             <Intersoft:UXMenuItem Header="Schedule a meeting" />
         </Intersoft:UXToolBarButton>

     </Intersoft:UXToolGroup>

 </Intersoft:UXToolBar>

The following illustration shows the UI example of each button type.

For more information about UXToolBar and its features, see UXToolBar 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.UXDropDownButton
                                    Intersoft.Client.UI.Aqua.UXSplitButton
                                       Intersoft.Client.UI.Aqua.UXToolBarButton
                                          Intersoft.Client.UI.Aqua.UXRibbon.UXRibbonToolBarButton
                                          Intersoft.Client.UI.ScheduleView.UXScheduleViewHeaderButton

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.