Back to Devexpress

BackstageItemWithImage.GlyphContainerStyle Property

wpf-devexpress-dot-xpf-dot-ribbon-dot-backstageitemwithimage-6bcebfc1.md

latest3.0 KB
Original Source

BackstageItemWithImage.GlyphContainerStyle Property

Gets or set’s a style applied to a container displaying a glyph within the current item. This is a dependency property.

Namespace : DevExpress.Xpf.Ribbon

Assembly : DevExpress.Xpf.Ribbon.v25.2.dll

NuGet Package : DevExpress.Wpf.Ribbon

Declaration

csharp
[Browsable(false)]
public Style GlyphContainerStyle { get; set; }
vb
<Browsable(False)>
Public Property GlyphContainerStyle As Style

Property Value

TypeDescription
Style

A Style object applied to a container displaying a glyph.

|

Remarks

Target Type : ContentControl.

Example

When you display an image with the BackstageButtonItem’s BackstageItemWithImage.Glyph property, the image is placed inside a glyph container. Use the BackstageItemWithImage.GlyphContainerStyle and BackstageItemWithImage.GlyphStyle properties to change the glyph container and image styles.

The following code sample specifies the image’s height and width to 32 pixels, a container’s height and width to 100 , and displays the image at the top left corner:

xaml
<Window.Resources>

        ...

        <Style x:Key="myGlyphStyle" TargetType="Image">
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="Height" Value="32"/>
            <Setter Property="Width" Value="32"/>
        </Style>

        <Style x:Key="myGlyphContainerStyle" TargetType="ContentControl">
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="Height" Value="100"/>
            <Setter Property="Width" Value="100"/>
        </Style>

        ...

    </Window.Resources>

<dxr:BackstageButtonItem Content="DevHelp" Glyph="D:\Work\Icon.png" GlyphStyle="{StaticResource myGlyphStyle}" GlyphContainerStyle="{StaticResource myGlyphContainerStyle}"/>
...

See Also

Glyph

GlyphStyle

BackstageItemWithImage Class

BackstageItemWithImage Members

DevExpress.Xpf.Ribbon Namespace