Skip to main content

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.v24.1.dll

NuGet Package: DevExpress.Wpf.Controls

Declaration

public ImageSource Glyph { get; set; }

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.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Glyph property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also