我开发了一个具有依赖属性的自定义控件
public static readonly DependencyProperty StateBorderBrushProperty =
DependencyProperty.Register("StateBorderBrush", typeof(Brush), typeof(SmartCanvas),
new FrameworkPropertyMetadata(Brushes.Transparent,
FrameworkPropertyMetadataOptions.None));
当我尝试从外部 xaml 设置控件的 ControlTemplate 时出现问题
<ControlTemplate TargetType="controls:SmartPrimitive">
<Grid>
<ContentPresenter/>
<Border BorderBrush="{TemplateBinding StateBorderBrush}" BorderThickness="2"/>
</Grid>
</ControlTemplate>
听起来像上面带有 TemplateBinding 的字符串中的“XamlParseException:字典中不存在给定的键”。有什么问题?