New to Telerik UI for WPF? Download free 30-day trial

Binding PathGeometry of a RadPathButton to Glyph


Product RadButtons for WPF


How to bind the PathGeometry property of a RadPathButton to a glyph.


Create a custom IValueConverter that returns a geometry based on a glyph string and set it to the Converter property of the PathGeometry binding.

public partial class MainWindow : Window 
    public MainWindow() 
        this.DataContext = this; 
    public string Glyph 
        get { return ""; } 
public class StringToGeometryConverter : IValueConverter 
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
        return RadGlyph.GetGeometry(this.GetGlyph(value.ToString()), "TelerikWebUI"); 
    private string GetGlyph(string hexCode) 
        string glyphInt = hexCode.Substring(3, 4); 
        var character = (char)int.Parse(glyphInt, NumberStyles.HexNumber); 
        return character.ToString(); 
    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 
        return null; 

        <local:StringToGeometryConverter x:Key="StringToGeometryConverter" /> 
    <telerik:RadPathButton  PathGeometry="{Binding Glyph, Converter={StaticResource StringToGeometryConverter}}" Width="75" Height="50" Content="Test" ContentPlacement="Right" /> 
PathButton with PathGeometry bound to glyph

The "local" namespace refers to the namespace, where the StringToGeometryConverter is defined.

See Also

In this article