Skip to end of metadata
Go to start of metadata

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
C#

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

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#
XAML

To learn more about commanding, see Commanding Overview.

Working with NavigateUri Property and TargetName Property

You can also use GlassButton to perform navigation to the specified NavigateUri and TargetName. This behavior is inherited from ISButton that implements INavigationSource interface.

The following example shows how to perform navigation using GlassButton.

XAML

 

To learn more about navigation, see Navigation Overview.

Definition

public class GlassButton : ISButton,

INavigationSource, INavigationSupport

Summary

The following table summarizes the members exposed in this class.

Public Constructors

GlassButton Constructor()Initializes a new instance of the GlassButton class.

Public Properties

NavigateUriGets or sets the URI to navigate when this button is clicked.
RootElementGets the root element.
SupportKeyboardFocus 
TargetNameGets or sets the name of a target window or frame that will display the content specified by the NavigationUri property.

Protected Properties

ProductProduct Info.

Fields

NavigateUriPropertyIdentifies the NavigationUri dependency property.
TargetNamePropertyIdentifies the TargetName dependency property.

Public Methods

InitializeTemplates()Initializes control templates.
OnApplyTemplate()Builds the visual tree for the GlassButton when a new template is applied.

Protected Methods

OnClick()Called before the Click event occurs.
TryNavigateCore()Called when the button is about to perform navigation based on specified URI.

Public Constructors

public GlassButton()

Initializes a new instance of the GlassButton class.

Public Properties

public Uri NavigateUri { get; set; }

Gets or sets the URI to navigate when this button is clicked.

public Grid RootElement { get; }

Gets the root element.

public bool SupportKeyboardFocus { get; }

 

public string TargetName { get; set; }

Gets or sets the name of a target window or frame that will display the content specified by the NavigationUri property.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty NavigateUriProperty

Identifies the NavigationUri dependency property.

public static readonly DependencyProperty TargetNameProperty

Identifies the TargetName dependency property.

Public Methods

public void InitializeTemplates()

Initializes control templates.

public void OnApplyTemplate()

Builds the visual tree for the GlassButton when a new template is applied.

Protected Methods

protected void OnClick()

Called before the Click event occurs.

protected bool TryNavigateCore()

Called when the button is about to perform navigation based on specified URI.

Return Types

True if the navigation succeed.
  • No labels