I have a custom control extending Image, and I will put some more data on top of that image. However, when I am trying to style the component, I am getting the error that my Custom Control do not have the property Template Error:
Cannot find the Style Property ‘Template’ on the type ‘MyCustomImage’
How can I style my custom control if Image does not have a Template Property?
Thanks
Edit:
Xaml:
<Style TargetType="{x:Type FieldComponents:MyCustomImage}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type FieldComponents:MyCustomImage}">
</ControlTemplate>
</Setter.Value>
</Setter>
</style>
Image inherits directly from FrameworkElement, not from Control, so it does not have a Template property. If you want to be able to template your control, you can inherit from Control or UserControl and have your template include an Image.