I am following the documentation from here:
But I would like to use a RadGlyph instead of an image url. Is there a way to use a RadGlyph instead of an image for the IconUrl property in the following class and template? I have not been able to get it to work.
public class MenuItem { public MenuItem() { this.SubItems = new ObservableCollection<MenuItem>(); } public string Text { get; set; } public Uri IconUrl { get; set; } public bool IsSeparator { get; set; } public ICommand Command { get; set; } public ObservableCollection<MenuItem> SubItems { get; set; } }
<Style x:Key="MenuItemStyle" TargetType="telerik:RadMenuItem"> <Setter Property="Icon" Value="{Binding IconUrl}"/> <Setter Property="IconTemplate"> <Setter.Value> <DataTemplate> <Image Source="{Binding}" Stretch="None"/> </DataTemplate> </Setter.Value> </Setter> <Setter Property="IsSeparator" Value="{Binding IsSeparator}"/> <Setter Property="Header" Value="{Binding Text}"/> <Setter Property="ItemsSource" Value="{Binding SubItems}"/> <Setter Property="Command" Value="{Binding Command}"/> </Style>
Regards,
Don