WPF - Border template with content



Let's assume I have the following control template:



<ControlTemplate x:Key="Test">
<Grid>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Width="33" Height="33" CornerRadius="3"/>
<ContentControl Content="{TemplateBinding Property=ContentControl.Content}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
</ControlTemplate>


How can I change content of the control in wpf? I've tried something like



<Control Template="{StaticResource Test}" BorderBrush="Black" Content="aa"></Control>


But when I do so I it says me that the property content is not recognized or it is not found.


No comments:

Post a Comment