8,735
社区成员
发帖
与我相关
我的任务
分享
static CustomControl1()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1), new FrameworkPropertyMetadata(typeof(CustomControl1)));
}
<Style TargetType="{x:Type local:CustomControl1}" x:Key="CustomControl1Style">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:CustomControl1}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Image Source="/WpfCustomControlLibrary;component/1.jpg"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>