Hello,
I am having problems applying an "IconTemplate" in a RadContextMenu. I thought at first there might be a DataContext problem but the "HeaderTemplate" property seems to be just fine....
Here is a sample piece of code to illustrate the problem:
I have attached a picture of what I see when I run this code. I would expect to see a "1" inside the green rectangle on item 1 but I don't....
Am I doing something incorrectly here or is this a bug?
I am having problems applying an "IconTemplate" in a RadContextMenu. I thought at first there might be a DataContext problem but the "HeaderTemplate" property seems to be just fine....
Here is a sample piece of code to illustrate the problem:
<
ToggleButton
Content
=
"Click Me"
Height
=
"100"
Width
=
"100"
IsChecked
=
"{Binding IsOpen, ElementName=rcm, Mode=TwoWay}"
>
<
ToggleButton.Resources
>
<
DataTemplate
x:Key
=
"ht"
>
<
Grid
>
<
Rectangle
Fill
=
"Pink"
Stroke
=
"Red"
StrokeThickness
=
"1"
Height
=
"20"
Width
=
"100"
/>
<
TextBlock
Text
=
"{Binding}"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Right"
Foreground
=
"Goldenrod"
FontSize
=
"20"
/>
</
Grid
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"it1"
>
<
Grid
>
<
Rectangle
Fill
=
"YellowGreen"
Stroke
=
"Green"
StrokeThickness
=
"1"
Height
=
"20"
Width
=
"20"
/>
<
TextBlock
Text
=
"{Binding}"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
/>
</
Grid
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"it2"
>
<
Grid
>
<
Rectangle
Fill
=
"YellowGreen"
Stroke
=
"Green"
StrokeThickness
=
"1"
Height
=
"20"
Width
=
"20"
/>
<
TextBlock
Text
=
"x"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
/>
</
Grid
>
</
DataTemplate
>
</
ToggleButton.Resources
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
x:Name
=
"rcm"
Placement
=
"Bottom"
IconColumnWidth
=
"50"
>
<
telerik:RadMenuItem
Header
=
"Item 1"
Icon
=
"1"
HeaderTemplate
=
"{StaticResource ht}"
IconTemplate
=
"{StaticResource it1}"
/>
<
telerik:RadMenuItem
Header
=
"Item 2"
Icon
=
"2"
HeaderTemplate
=
"{StaticResource ht}"
IconTemplate
=
"{StaticResource it2}"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
</
ToggleButton
>
I have attached a picture of what I see when I run this code. I would expect to see a "1" inside the green rectangle on item 1 but I don't....
Am I doing something incorrectly here or is this a bug?