CommandButton.Glyph Property

Gets or sets the icon displayed in the current button. This is a dependency property.

Namespace: DevExpress.Xpf.WindowsUI

Assembly: DevExpress.Xpf.Controls.v20.1.dll

Declaration

public ImageSource Glyph { get; set; }
Public Property Glyph As ImageSource

Property Value

Type Description
ImageSource

An ImageSource object that specifies the icon displayed in the current button.

Remarks

The Glyph property allows you to provide an icon for the current button. The CommandButton.GlyphWidth and CommandButton.GlyphHeight properties specify the dimensions of the frame into which the glyph is fitted. The CommandButton.GlyphStretch property specifies how the glyph is stretched to fill the frame. The code snippet below shows how to provide the AppBarButton control with an icon from the DX Image Gallery.

xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxwui="http://schemas.devexpress.com/winfx/2008/xaml/windowsui"

<dxwui:AppBarButton Glyph="{dx:DXImageGrayscale Image=Zoom_32x32.png}"
                    AllowGlyphTheming="True"
                    GlyphHeight="24"
                    GlyphWidth="24"
                    GlyphStretch="Uniform"

                    IsEllipseEnabled="True"
                    EllipseDiameter="32"
                    StrokeThickness="1"
                    />

The result of this markup is shown below. Note that the glyph is rendered using the theming feature (see CommandButton.AllowGlyphTheming).

CommandButton_Sample

Control images can be automatically substituted for other images based on the app context (the system DPI setting, the application UI culture, paint theme and touch mode availability). See the following topic to learn more: Automatically Choosing Images Based on App Context.

See Also