0
我有风情的菜单项:菜单项风格的图像
<Style x:Key="mainMenuItem"
TargetType="{x:Type Resources:MainMenuItem}">
</Style>
我怎样才能设置图标属性TemplateBinding的ImageSource? 我有MainMenuItem.cs:
public class MainMenuItem : MenuItem
{
public static readonly DependencyProperty ImageSourceProperty =
DependencyProperty.Register(
"ImageSource",
typeof (ImageSource),
typeof (MainMenuItem),
new UIPropertyMetadata(null));
public ImageSource ImageSource
{
get { return (ImageSource) GetValue(ImageSourceProperty); }
set { SetValue(ImageSourceProperty, value); }
}
}