Intersoft ClientUI Documentation
GlassButton Class
Members 



Provides a lightweight button control with a glassed themed.
Object Model
GlassButton ClassISFramework Class
Syntax
<TemplateVisualStateAttribute(Name="Disabled", GroupName="CommonStates")>
<TemplatePartAttribute(Name="BaseColor", Type=System.Windows.Controls.Border)>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")>
<TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")>
<TemplatePartAttribute(Name="ContentPresenter", Type=System.Windows.Controls.ContentPresenter)>
<TemplateVisualStateAttribute(GroupName="FocusStates", Name="Focused")>
<TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)>
<TemplatePartAttribute(Name="ShineGlow", Type=System.Windows.Controls.Border)>
<TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")>
<DescriptionAttribute("Provides a lightweight button control with a glass style.")>
<TemplatePartAttribute(Name="GlassElement", Type=System.Windows.Controls.Grid)>
<TemplatePartAttribute(Name="SpreadColor", Type=System.Windows.Controls.Border)>
<TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)>
<TemplatePartAttribute(Name="GlassColor", Type=System.Windows.Controls.Border)>
Public Class GlassButton 
   Inherits Intersoft.Client.Framework.ISButton
   Implements Intersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, Intersoft.Client.Framework.INavigationSourceIntersoft.Client.Framework.INavigationSupportIntersoft.Client.Framework.Input.ICommandSourceIntersoft.Client.Framework.Input.IKeyboardFocus 
Dim instance As GlassButton
[TemplateVisualStateAttribute(Name="Disabled", GroupName="CommonStates")]
[TemplatePartAttribute(Name="BaseColor", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")]
[TemplatePartAttribute(Name="ContentPresenter", Type=System.Windows.Controls.ContentPresenter)]
[TemplateVisualStateAttribute(GroupName="FocusStates", Name="Focused")]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[TemplatePartAttribute(Name="ShineGlow", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")]
[DescriptionAttribute("Provides a lightweight button control with a glass style.")]
[TemplatePartAttribute(Name="GlassElement", Type=System.Windows.Controls.Grid)]
[TemplatePartAttribute(Name="SpreadColor", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="GlassColor", Type=System.Windows.Controls.Border)]
public class GlassButton : Intersoft.Client.Framework.ISButton, Intersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, Intersoft.Client.Framework.INavigationSourceIntersoft.Client.Framework.INavigationSupportIntersoft.Client.Framework.Input.ICommandSourceIntersoft.Client.Framework.Input.IKeyboardFocus  
[TemplateVisualStateAttribute(Name="Disabled", GroupName="CommonStates")]
[TemplatePartAttribute(Name="BaseColor", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Normal")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Checked")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="MouseOver")]
[TemplateVisualStateAttribute(GroupName="CommonStates", Name="Pressed")]
[TemplatePartAttribute(Name="ContentPresenter", Type=System.Windows.Controls.ContentPresenter)]
[TemplateVisualStateAttribute(GroupName="FocusStates", Name="Focused")]
[TemplatePartAttribute(Name="RootElement", Type=System.Windows.Controls.Grid)]
[TemplatePartAttribute(Name="ShineGlow", Type=System.Windows.Controls.Border)]
[TemplateVisualStateAttribute(GroupName="FocusStates", Name="Unfocused")]
[DescriptionAttribute("Provides a lightweight button control with a glass style.")]
[TemplatePartAttribute(Name="GlassElement", Type=System.Windows.Controls.Grid)]
[TemplatePartAttribute(Name="SpreadColor", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="DisabledVisualElement", Type=System.Windows.Controls.Border)]
[TemplatePartAttribute(Name="GlassColor", Type=System.Windows.Controls.Border)]
public ref class GlassButton : public Intersoft.Client.Framework.ISButton, Intersoft.Client.Framework.IControlIntersoft.Client.Framework.IFramework, Intersoft.Client.Framework.ILicensing, Intersoft.Client.Framework.INavigationSourceIntersoft.Client.Framework.INavigationSupportIntersoft.Client.Framework.Input.ICommandSourceIntersoft.Client.Framework.Input.IKeyboardFocus  
Remarks

GlassButton is inherited from ISButton class which includes fundamental features such as Commanding, Navigation, Toggle, ClickMode and more. To learn more about commanding, see Commanding Overview. To learn more about navigation, see Navigation Overview.

XAML
Copy Code
<Intersoft:GlassButton Content="Try Now" VerticalAlignment="Top" HorizontalAlignment="Left" Padding="8,4" Click="GlassButton_Click"></Intersoft:GlassButton>
C#
Copy Code
private void GlassButton_Click(object sender, RoutedEventArgs e)
{
    MessageBox.Show("Glass Button Clicked");
}

Toggle Button

To configure GlassButton as toggle button you need to set the IsToggleButton property to True and specify the GroupName that group the buttons together.

The following example shows how to configure GlassButton as toggle button.

XAML
Copy Code
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
        <Intersoft:GlassButton Content="ON" Width="50" GroupName="ToggleGroup" IsToggleButton="True" IsChecked="True"/>
        <Intersoft:GlassButton Content="OFF" Width="50" GroupName="ToggleGroup" IsToggleButton="True"/>
</StackPanel>

Commanding

Similar to other button controls in ClientUI, GlassButton supports commands that you can bind using MVVM pattern.

The following example shows how to bind a command to GlassButton.

C#
Copy Code
using System.ComponentModel;
using System.Windows;
using Intersoft.Client.Framework.Input;

namespace ClientUI.Samples.ViewModels
{
    public class MainPageViewModel : INotifyPropertyChanged
    {
        public DelegateCommand SubmitCommand { get; set; }

        public MainPageViewModel()
        {
            this.SubmitCommand = new DelegateCommand(ExecuteSubmit, CanExecuteSubmit);
        }

        private bool CanExecuteSubmit(object parameter)
        {
            return true; // you can use validation here to determine when the command is available.
        }

        private void ExecuteSubmit(object parameter)
        {
            MessageBox.Show("Submit");
        }

        protected void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;

            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
XAML
Copy Code
<Grid x:Name="LayoutRoot" Background="White">
    <Grid.DataContext>
        <vm:MainPageViewModel/>
    </Grid.DataContext>
    <Intersoft:GlassButton Content="Submit" HorizontalAlignment="Center" VerticalAlignment="Center" Command="{Binding SubmitCommand}">            
    </Intersoft:GlassButton>
</Grid>

To learn more about commanding, see Commanding 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.Controls.GlassButton
                              Intersoft.Client.UI.Aqua.UXFlow.UXFlowControlPanelButton
                              Intersoft.Client.UI.Aqua.UXFlow.VideoPlayerButton

Requirements

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

See Also

Reference

GlassButton Members
Intersoft.Client.UI.Controls Namespace

Concepts

GlassButton

Send Feedback